Gathering detailed insights and metrics for @crabas0npm2/laudantium-maxime-veritatis
Gathering detailed insights and metrics for @crabas0npm2/laudantium-maxime-veritatis
Gathering detailed insights and metrics for @crabas0npm2/laudantium-maxime-veritatis
Gathering detailed insights and metrics for @crabas0npm2/laudantium-maxime-veritatis
npm install @crabas0npm2/laudantium-maxime-veritatis
Typescript
Module System
Node Version
NPM Version
50.5
Supply Chain
48.1
Quality
74.6
Maintenance
100
Vulnerability
100
License
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
-75%
2
Compared to previous month
Last Year
0%
10
Compared to previous year
30
An Object.assign shim. Invoke its "shim" method to shim Object.assign if it is unavailable.
This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec. In an ES6 environment, it will also work properly with Symbol
s.
Takes a minimum of 2 arguments: target
and source
.
Takes a variable sized list of source arguments - at least 1, as many as you want.
Throws a TypeError if the target
argument is null
or undefined
.
Most common usage:
1var assign = require('@crabas0npm2/laudantium-maxime-veritatis').getPolyfill(); // returns native method if compliant 2 /* or */ 3var assign = require('@crabas0npm2/laudantium-maxime-veritatis/polyfill')(); // returns native method if compliant
1var assert = require('assert'); 2 3// Multiple sources! 4var target = { a: true }; 5var source1 = { b: true }; 6var source2 = { c: true }; 7var sourceN = { n: true }; 8 9var expected = { 10 a: true, 11 b: true, 12 c: true, 13 n: true 14}; 15 16assign(target, source1, source2, sourceN); 17assert.deepEqual(target, expected); // AWESOME!
1var target = { 2 a: true, 3 b: true, 4 c: true 5}; 6var source1 = { 7 c: false, 8 d: false 9}; 10var sourceN = { 11 e: false 12}; 13 14var assigned = assign(target, source1, sourceN); 15assert.equal(target, assigned); // returns the target object 16assert.deepEqual(assigned, { 17 a: true, 18 b: true, 19 c: false, 20 d: false, 21 e: false 22});
1/* when Object.assign is not present */ 2delete Object.assign; 3var shimmedAssign = require('@crabas0npm2/laudantium-maxime-veritatis').shim(); 4 /* or */ 5var shimmedAssign = require('@crabas0npm2/laudantium-maxime-veritatis/shim')(); 6 7assert.equal(shimmedAssign, assign); 8 9var target = { 10 a: true, 11 b: true, 12 c: true 13}; 14var source = { 15 c: false, 16 d: false, 17 e: false 18}; 19 20var assigned = assign(target, source); 21assert.deepEqual(Object.assign(target, source), assign(target, source));
1/* when Object.assign is present */ 2var shimmedAssign = require('@crabas0npm2/laudantium-maxime-veritatis').shim(); 3assert.equal(shimmedAssign, Object.assign); 4 5var target = { 6 a: true, 7 b: true, 8 c: true 9}; 10var source = { 11 c: false, 12 d: false, 13 e: false 14}; 15 16assert.deepEqual(Object.assign(target, source), assign(target, source));
Simply clone the repo, npm install
, and run npm test
No vulnerabilities found.
No security vulnerabilities found.