I am dealing with an object that has nested properties:
{
x: {
y: {
z: { min: 1, max: 2 },
w: 5
}
}
}
The levels of nesting can vary. It can end with an object containing properties like 'min', 'max', or 'in', or it can simply be a non-object like a string, number, or boolean value.
My goal is to create a string representing the path to those endpoints.
For example, if we take the above object, I would want the resulting string to be as follows:
objPaths(x)
=> {
"x.y.z": { min: 1, max: 2 }
"x.y.w": 5
}