Returns a representation of the object as a set of paths and data.
const o = { name: `hello`, size: 20, colour: { r:200, g:100, b:40 } }const pd = [...getPathsAndData(o)];// Yields:// [ // { path: `name`, value: `hello` },// { path: `size`, value: `20` },// { path: `colour.r`, value: `200` },// { path: `colour.g`, value: `100` },// { path: `colour.b`, value: `40` }//] Copy
const o = { name: `hello`, size: 20, colour: { r:200, g:100, b:40 } }const pd = [...getPathsAndData(o)];// Yields:// [ // { path: `name`, value: `hello` },// { path: `size`, value: `20` },// { path: `colour.r`, value: `200` },// { path: `colour.g`, value: `100` },// { path: `colour.b`, value: `40` }//]
Object to get paths and data for
Set maximum recursion depth. By default unlimited.
Manually set a path prefix if it's necessary
Returns a representation of the object as a set of paths and data.