dot-path-value
dot-path-value copied to clipboard
Safely get and set deep nested properties using dot notation.
I'm coming from a specific use case on my side where I have an initial path and want to manipulate the object with a relative path from the initial. After...
It seems that `Path` doesn't pick out object keys which are numbers, rather than strings. For example: ```ts const obj = { days: { 1: true, "2": false, 3: true...
I am using `getByPath` in a helper function and passing in a `Path` as a parameter. The path is useful to me in another package, which takes an array rather...
Hi, Thanks for the library. It would be great if it provided an `hasByPath()` method to check the path's availability. Thanks,
Hi, It seems that passing a generic which extends something does not correctly resolve at least the extended options: Reproduction: https://tsplay.dev/NaEx9N
## The issue Given the following code: ```ts import { getByPath } from 'dot-path-value'; type Recursive = { a: string; r: Recursive; }; function x(type: Recursive) { getByPath(type, ''); ~~~~~~~~~~~~...
I have found a prototype pollution vulnerability, below is the PoC: ``` var path = require('dot-path-value'); assert(({}).polluted === undefined); path.setByPath({}, '__proto__.polluted', 'yes'); // or path.setByPath({}, 'constructor.prototype.polluted', 'yes') assert(({}).polluted === 'yes');...