Gathering detailed insights and metrics for split-keypath
Gathering detailed insights and metrics for split-keypath
Gathering detailed insights and metrics for split-keypath
Gathering detailed insights and metrics for split-keypath
Splits strings into an array of keys used for reading nested data structures
npm install split-keypath
Typescript
Module System
Node Version
NPM Version
JavaScript (83.08%)
HTML (16.92%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
10 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Mar 23, 2016
Latest Version
1.0.1
Package Id
split-keypath@1.0.1
Size
5.61 kB
NPM Version
3.7.3
Node Version
5.9.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Splits strings into an array of keys used for reading nested data structures
split-keypath is a method that takes a string as an input and generates an array of keys that can be used for reading values from a deeply nested object. The algorithm supports extracting array keys, which is how you can specify arbitrary keys. Please see below for examples.
$ npm install split-keypath
The npm package has a bundle for the browser
1import splitKeypath from "split-keypath"; 2var result = splitKeypath("hello.world"); 3// Result is ["hello", "world"]
1import splitKeypath from "split-keypath"; 2var result = splitKeypath("hello[0].world[some really long string. with non ascii chars.]"); 3// Result is ["hello", "0", "world", "some really long string. with non ascii chars."];
Practical use that reads a value from a somewhat deeply nested object hierarchy
1import splitKeypath from "split-keypath"; 2 3function readDeepValue(input, keypath) { 4 return splitKeypath(keypath).reduce((nested, key) => nested[key], input); 5} 6 7var input = { 8 some: { 9 deep: [ 10 { 11 key: 42 12 } 13 ] 14 } 15}; 16 17var result = readDeepValue(input, "some.deep[0].key"); 18// Result is 42
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More