Gathering detailed insights and metrics for define-data-property
Gathering detailed insights and metrics for define-data-property
Gathering detailed insights and metrics for define-data-property
Gathering detailed insights and metrics for define-data-property
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
npm install define-data-property
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
43 Commits
2 Watching
2 Branches
1 Contributors
Updated on 07 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.9%
7,630,863
Compared to previous day
Last week
2.3%
43,940,391
Compared to previous week
Last month
7.3%
182,831,573
Compared to previous month
Last year
875%
1,714,049,279
Compared to previous year
3
27
Define a data property on an object. Will fall back to assignment in an engine without descriptors.
The three non*
argument can also be passed null
, which will use the existing state if available.
The loose
argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment.
1var defineDataProperty = require('define-data-property'); 2var assert = require('assert'); 3 4var obj = {}; 5defineDataProperty(obj, 'key', 'value'); 6defineDataProperty( 7 obj, 8 'key2', 9 'value', 10 true, // nonEnumerable, optional 11 false, // nonWritable, optional 12 true, // nonConfigurable, optional 13 false // loose, optional 14); 15 16assert.deepEqual( 17 Object.getOwnPropertyDescriptors(obj), 18 { 19 key: { 20 configurable: true, 21 enumerable: true, 22 value: 'value', 23 writable: true, 24 }, 25 key2: { 26 configurable: false, 27 enumerable: false, 28 value: 'value', 29 writable: true, 30 }, 31 } 32);
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Score
Last Scanned on 2024-11-18
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