package
Push an array of items into an array, while being robust against prototype modification
npm install safe-push-applyGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Push an array of items into an array, while being robust against prototype modification.
npm install --save safe-push-applyvar safePushApply = require('safe-push-apply');
var assert = require('assert');
var arr = [1, 2, 3];
var orig = Array.prototype[Symbol.iterator];
delete Array.prototype[Symbol.iterator];
assert.throws(() => {
try {
arr.push(...[3, 4, 5]);
} finally {
Array.prototype[Symbol.iterator] = orig;
}
Simply clone the repo, npm install, and run npm test
Estimated unpacked size across 3 packages.
23.7 kB
Includes dependencies.
^1.3.0
1.3.0