Gathering detailed insights and metrics for safe-array-concat
Gathering detailed insights and metrics for safe-array-concat
Gathering detailed insights and metrics for safe-array-concat
Gathering detailed insights and metrics for safe-array-concat
`Array.prototype.concat`, but made safe by ignoring Symbol.isConcatSpreadable
npm install safe-array-concat
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
5 Stars
29 Commits
1 Forks
2 Watching
1 Branches
2 Contributors
Updated on 05 Sept 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.7%
4,870,648
Compared to previous day
Last week
2.1%
27,660,318
Compared to previous week
Last month
6.7%
115,724,547
Compared to previous month
Last year
316.1%
1,145,453,955
Compared to previous year
4
Array.prototype.concat
, but made safe by ignoring Symbol.isConcatSpreadable
1npm install --save safe-array-concat
1var safeConcat = require('safe-array-concat'); 2var assert = require('assert'); 3 4assert.deepEqual([].concat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with normal concat'); 5assert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with safe concat'); 6 7String.prototype[Symbol.isConcatSpreadable] = true; 8assert.deepEqual([].concat('foo', Object('bar')), ['foo', 'b', 'a', 'r'], 'spreadable String objects are spread with normal concat!!!'); 9assert.deepEqual(safeConcat('foo', Object('bar')), ['foo', Object('bar')], 'spreadable String objects are not spread with safe concat'); 10 11Array.prototype[Symbol.isConcatSpreadable] = false; 12assert.deepEqual([].concat([1, 2], 3, [[4]]), [[], [1, 2], 3, [[4]]], 'non-concat-spreadable arrays do not spread with normal concat!!!'); 13assert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'non-concat-spreadable arrays still spread with safe concat');
Simply clone the repo, npm install
, and run npm test
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
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- 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
Reason
SAST tool is not run on all commits -- score normalized to 0
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