Iterates 'paths' for all the fields on o
o
const d = { accel: { x: 1, y: 2, z: 3 }, gyro: { x: 4, y: 5, z: 6 }};const paths = [...getFieldPaths(d)];// Yields [ `accel`, `gyro`, `accel.x`, `accel.y`,`accel.z`,`gyro.x`,`gyro.y`,`gyro.z` ] Copy
const d = { accel: { x: 1, y: 2, z: 3 }, gyro: { x: 4, y: 5, z: 6 }};const paths = [...getFieldPaths(d)];// Yields [ `accel`, `gyro`, `accel.x`, `accel.y`,`accel.z`,`gyro.x`,`gyro.y`,`gyro.z` ]
Use getField to fetch data based on a path
If object is null or undefined, no results are returned.
If onlyLeaves is true (default: false), only 'leaf' nodes are included. Leaf nodes are those that contain a primitive value.
onlyLeaves
const paths = getFieldPaths(d, true);// Yields [ `accel.x`, `accel.y`,`accel.z`,`gyro.x`,`gyro.y`,`gyro.z` ] Copy
const paths = getFieldPaths(d, true);// Yields [ `accel.x`, `accel.y`,`accel.z`,`gyro.x`,`gyro.y`,`gyro.z` ]
Object to get paths for.
If true, only paths with a primitive value are returned.
Iterates 'paths' for all the fields on
o
Use getField to fetch data based on a path
If object is null or undefined, no results are returned.
If
onlyLeaves
is true (default: false), only 'leaf' nodes are included. Leaf nodes are those that contain a primitive value.