Gathering detailed insights and metrics for unset-value
Gathering detailed insights and metrics for unset-value
Gathering detailed insights and metrics for unset-value
Gathering detailed insights and metrics for unset-value
Delete nested properties from an object using dot notation.
npm install unset-value
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
34 Stars
24 Commits
12 Forks
4 Watching
1 Branches
7 Contributors
Updated on 23 Jul 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-9.6%
2,626,555
Compared to previous day
Last week
2.8%
16,520,833
Compared to previous week
Last month
33.6%
61,487,212
Compared to previous month
Last year
-21.3%
624,115,888
Compared to previous year
3
Delete nested properties from an object using dot notation.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
1$ npm install --save unset-value
1var unset = require('unset-value'); 2unset(obj, prop);
obj
{object}: The object to unset prop
onprop
{string | string[]}: The property to unset. Dot-notation may be used or an array of nested properties.1var obj = {a: 'b'}; 2unset(obj, 'a'); 3console.log(obj); 4//=> {}
1unset({a: 'b'}, 'a') // true
true
when a property does not existThis is consistent with delete
behavior in that it does not
throw when a property does not exist.
1unset({a: {b: {c: 'd'}}}, 'd') // true
1var one = {a: {b: {c: 'd'}}}; 2unset(one, 'a.b'); 3console.log(one); 4//=> {a: {}} 5 6var two = {a: {b: {c: 'd'}}}; 7unset(two, ['a', 'b', 'c']); 8console.log(two); 9//=> {a: {b: {}}} 10 11var three = {a: {b: {c: 'd', e: 'f'}}}; 12unset(three, 'a.b.c'); 13console.log(three); 14//=> {a: {b: {e: 'f'}}}
1unset(); 2// 'expected an object.'
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
a.b.c
and… more | homepage'a.b.c'
) paths. | homepage'a.b.c'
) paths. | homepageCommits | Contributor |
---|---|
11 | jonschlinkert |
4 | danez |
2 | wtgtybhertgeghgtwtg |
1 | TrySound |
1 | bluelovers |
Jon Schlinkert
Copyright © 2021, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on March 18, 2021.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/21 approved changesets -- score normalized to 1
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
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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