Take any input: nested array, nested plain object or whatever really, no matter how deeply nested. Walk through it recursively and if you find any plain objects, assign all their keys to a given second input's argument OR default,
It does not mutate the input arguments. Operations are done on a cloned input.
We needed this library to overwrite all values to be
false on JSON schema objects, so that later when we copy from key/value pairs from schema, values are equal to
false and we don't need to prep them further.
This library is well-tested and is being used in commercial projects.
The main function
setAllValuesTo() is imported like this:
It's a function which takes two input arguments:
|Plain object||yes||n/a||JSON-like data structure.|
|Any||no||boolean ||Assign all the found plain object values to this|
The function will return a clone of
input with values overwritten (where applicable).
You can import