Gathering detailed insights and metrics for dot-values2
Gathering detailed insights and metrics for dot-values2
Gathering detailed insights and metrics for dot-values2
Gathering detailed insights and metrics for dot-values2
npm install dot-values2
Typescript
Module System
Node Version
NPM Version
71.4
Supply Chain
84.3
Quality
74.4
Maintenance
100
Vulnerability
100
License
TypeScript (81.24%)
HTML (10.4%)
JavaScript (8.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
33 Commits
1 Watchers
1 Branches
2 Contributors
Updated on Jun 09, 2022
Latest Version
2.0.7
Package Id
dot-values2@2.0.7
Unpacked Size
48.27 kB
Size
10.14 kB
File Count
54
NPM Version
10.2.4
Node Version
21.6.1
Published on
Mar 03, 2024
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
dot-values
is a collection of dot path object mutators (get-value, has-value, set-value, unset-value) with one neat addition...
1const _ = require('dot-values2') 2 3let request = { 4 header: { 5 content_type: 'application/json' 6 }, 7 body: { 8 parts: [ 9 { 10 content: '...', 11 featured: true 12 }, 13 { 14 content: '!!!' 15 } 16 ] 17 } 18} 19 20_.get(request, 'header.content_type') 21// "application/json" 22 23_.get(request, 'body.parts.1.featured') 24// true 25 26_.get(request, 'body.parts.*.content') 27// ['...', '!!!'] 28 29_.has(request, 'body.parts.*.featured') 30// false 31// only true if all items have the attribute 32 33_.set(request, 'body.parts.*.bool', true) 34// now all parts would have an attribute bool: true 35 36// but you can go even deeper like 37_.get(request, 'body.users.*.permissions.*.name') 38// ['admin', 'editor', 'publisher', 'admin' ...] 39// be aware that this does not return unique values, but all the values in order 40// if you want unique values though, you can do something like 41// https://stackoverflow.com/questions/1960473/get-all-unique-values-in-an-array-remove-duplicates
So just to clarify, you can reference arrays of objects with an asterisk (*
).
Also _.get
takes a default return value as the third argument (that applies to array values too).
Otherwise everything works as the original modules.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
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
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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