Do you want to request a feature or report a bug?
Bug
What is the current behavior?
If a get is performed with a non-existent path, and a parent of the path does exist and is a falsy value, then that value is returned instead of undefined.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
From the node REPL:
> mpath.get('x.y', { x: 0 })
0 // Expect: undefined
> mpath.get('x.y', { x: false })
false // Expect: undefined
> mpath.get('x.y', { x: null })
null // Expect: undefined
> mpath.get('x.y', { x: 1 })
undefined // Ok
> mpath.get('x.y', { x: { y: 'z' } })
'z' // Ok
What are the versions of Node.js and mpath are you are using? Note that "latest" is not a version.
node 16.19.0
mpath 0.9.0