to-path
Converts string to a property path array.
Install
$ npm install --save to-path
Usage
For more use-cases see the tests
var toPath = ; ; // => ['a']; // => ['a', 'b', 'c']; // => ['a', '0', 'b', 'c']; // => ['a', 'x', 'b', 'c']; // => ['a', 'x', 'b', 'c']; // => ['0']; // => ['1', '2', '3']
Related
- object-at - Get object's property according to the path.
- object-has - Checks if path is a direct property of object.
- object-set - Sets the value at path of object.
- object-unset - Removes the property at path of object.
Contributing
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.