1.1.0 • Published 8 years ago
pathseq v1.1.0
pathseq
Dead simple object path to sequence converter. It breaks a path to an object nested value down to a sequence form.
Install
pathseq is available to download through NPM.
npm install pathseqUse
pathseq(path);Arguments
path (string) object nested value path.
Returns
(array) object nested value path sequence.
Examples
Basic use:
const path = 'foo.bar.baz';
const sequence = pathseq(path); // ['foo', 'bar', 'baz']You can work with arrays too:
const path = 'foo[1].bar[2][3].baz';
const sequence = pathseq(path); // ['foo', 1, 'bar', 2, 3, 'baz']Develop
If you want to fork and develop pathseq, these commands are for you:
npm run dev
npm run test-devTest
pathseq is equipped with a test suite. You can run it with:
npm run testLicence
MIT