Installations
npm install es6-set
Developer
medikoo
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
>=0.12
Typescript Support
No
Node Version
16.16.0
NPM Version
8.11.0
Statistics
46 Stars
118 Commits
9 Forks
3 Watching
1 Branches
1 Contributors
Updated on 21 Nov 2022
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
971,670,280
Last day
-6.5%
504,850
Compared to previous day
Last week
3.3%
3,116,275
Compared to previous week
Last month
27.8%
11,579,856
Compared to previous month
Last year
-14.9%
121,548,212
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
6
Dev Dependencies
7
es6-set
Set collection as specified in ECMAScript6
Warning:
v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0
Usage
If you want to make sure your environment implements Set
, do:
1require("es6-set/implement");
If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing Set
on global scope, do:
1var Set = require("es6-set");
If you strictly want to use polyfill even if native Set
exists, do:
1var Set = require("es6-set/polyfill");
Installation
$ npm install es6-set
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack
API
Best is to refer to specification. Still if you want quick look, follow examples:
1var Set = require("es6-set"); 2 3var set = new Set(["raz", "dwa", {}]); 4 5set.size; // 3 6set.has("raz"); // true 7set.has("foo"); // false 8set.add("foo"); // set 9set.size; // 4 10set.has("foo"); // true 11set.has("dwa"); // true 12set.delete("dwa"); // true 13set.size; // 3 14 15set.forEach(function (value) { 16 // 'raz', {}, 'foo' iterated 17}); 18 19// FF nightly only: 20for (value of set) { 21 // 'raz', {}, 'foo' iterated 22} 23 24var iterator = set.values(); 25 26iterator.next(); // { done: false, value: 'raz' } 27iterator.next(); // { done: false, value: {} } 28iterator.next(); // { done: false, value: 'foo' } 29iterator.next(); // { done: true, value: undefined } 30 31set.clear(); // undefined 32set.size; // 0
Tests
$ npm test
Security contact information
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
No vulnerabilities found.
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: topLevel permissions set to 'read-all': .github/workflows/integrate.yml:9
- Info: topLevel permissions set to 'read-all': .github/workflows/publish.yml:10
- Info: topLevel permissions set to 'read-all': .github/workflows/validate.yml:9
- Info: no jobLevel write permissions found
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: ISC License: LICENSE:0
Reason
badge detected: Passing
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
6.1
/10
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