1.1.30 • Published 11 months ago

@juigorg/tenetur-asperiores-architecto v1.1.30

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@juigorg/tenetur-asperiores-architecto Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

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 Symbols.

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:

var assign = require('@juigorg/tenetur-asperiores-architecto').getPolyfill(); // returns native method if compliant
	/* or */
var assign = require('@juigorg/tenetur-asperiores-architecto/polyfill')(); // returns native method if compliant

Example

var assert = require('assert');

// Multiple sources!
var target = { a: true };
var source1 = { b: true };
var source2 = { c: true };
var sourceN = { n: true };

var expected = {
	a: true,
	b: true,
	c: true,
	n: true
};

assign(target, source1, source2, sourceN);
assert.deepEqual(target, expected); // AWESOME!
var target = {
	a: true,
	b: true,
	c: true
};
var source1 = {
	c: false,
	d: false
};
var sourceN = {
	e: false
};

var assigned = assign(target, source1, sourceN);
assert.equal(target, assigned); // returns the target object
assert.deepEqual(assigned, {
	a: true,
	b: true,
	c: false,
	d: false,
	e: false
});
/* when Object.assign is not present */
delete Object.assign;
var shimmedAssign = require('@juigorg/tenetur-asperiores-architecto').shim();
	/* or */
var shimmedAssign = require('@juigorg/tenetur-asperiores-architecto/shim')();

assert.equal(shimmedAssign, assign);

var target = {
	a: true,
	b: true,
	c: true
};
var source = {
	c: false,
	d: false,
	e: false
};

var assigned = assign(target, source);
assert.deepEqual(Object.assign(target, source), assign(target, source));
/* when Object.assign is present */
var shimmedAssign = require('@juigorg/tenetur-asperiores-architecto').shim();
assert.equal(shimmedAssign, Object.assign);

var target = {
	a: true,
	b: true,
	c: true
};
var source = {
	c: false,
	d: false,
	e: false
};

assert.deepEqual(Object.assign(target, source), assign(target, source));

Tests

Simply clone the repo, npm install, and run npm test

workeromitweakseta11ydescriptorlruBigUint64Arrayrgbemojilimitmulti-packagesearchconsumechannelenvironmentauthenticationdeepcopybcryptponyfillthrottlehashinWebSocketspushcoercibleupECMAScript 2022assignshamajaxroutingArray.prototype.flattypeofSetflagswebsymbolfunctionalrecursiveReactiveXserializeelasticacheratelimitchineseautoscalingdataarraysspinnersincludesnodejsoncesortedjoibrowserlistsequenceString.prototype.trimdom-testing-librarywatchclassesarrayflatMapES2016corebyteOffsetsafemkdireslintpluginutil.inspectcensorforEachwatcherfile systemshellECMAScript 2015mime-dbECMAScript 2016arraybuffercreateapicomparesymlinkjsxredactexpressUint8Arrayflatform-validationwatchingrmdirstarteridES2021lintassertmetadataes2015privatepromiseECMAScript 2019walksyntaxerrorInt32ArraybytetoArrayObservablepluginerrorbatchECMAScript 5spinnerECMAScript 2017colorsrapid0asciistatelesspackagesObject.valuesesjsdomJSON-Schemamkdirpasyncnopefullwidthdeletefixed-widths3ecmascriptwritetoolkitexpressionduplexdomvariablesArray.prototype.flatMaprangeerrorrm -rfutilitiestelephoneworkflowrequiretypedarrayHyBiownparentfunctionscharactersameValueZeroArray.prototype.flattendirregular expressionsRegExp.prototype.flagslibphonenumbercloudtrailSymbol.toStringTagdescriptorsextendECMAScript 2021cacheObject.assigndeepcloneFloat64Arrayes8east-asian-widthUnderscorebuffersautoprefixershrinkwraptypeprogressspeedmakees-shimscss less@@toStringTagfromshimbootstrap lessinstallerassertsminimalpostcsslinkajvttytostringtagRxJStoStringTagtypesafees-abstractswfpostcss-pluginpromisesrm -frenvReflect.getPrototypeOfkarmatrimRightargsvalueES2018Uint16ArrayECMAScript 3fssuperagentWeakMapcss-in-jsArray.prototype.containspropertiesmodulesvisualvalidparentsformsES2022jsdiffquerystringless mixinsobjfull-widthObject.entriesRegExp#flagsdropjavascriptredirecthasreducerstreamIteratoreventsiteratorebsSymbolflagmoduleUint32ArrayURLSearchParamsconsolefast-deep-cloneresolvesnsfast-deep-copyelbargvcolumnstdlibreadurlemitfpsclassnames__proto__trimStartAsyncIteratorlessschemanegative zerostylesqssyntaxwarninginternalsetreactUint8ClampedArrayawesomesauceFunction.prototype.namedebugredux-toolkitwatchFiledataViewmergegroupes2017termchromelistenersstylesheetexectapehelperslengthconnectArray.prototype.includesreal-timegdprprotocol-buffersstreamsbyteLengthimmutablebrowserslistES5mochamimetsdependenciesES8argparseES2020eventDispatcherTypeBoxparsemake dirsimpledbtakeWebSocketfind-upwalkingperformanteventEmittercolumnsregulares-shim APIregexpackageES3livepreserve-symlinksdeterministicshebangfastclonerandomreact-hook-formcall-boundreduxES2015ES2017waitbluebirdxtermgetPrototypeOfjsinferencecodescharacterspolyfillhttpbusyremoveparsingthroattexttrimESuuidelmsuperstructhasOwnpipejestbindgroupByratelinewraptestingcopycollection.es6tapfindupECMAScript 2023compile lesstypedarraysjwttrimEndvariables in cssextensionclienttypanionregular expressiondayjsterminaltddcontainskeycallbindframeworkassertionimportwordwrapefficientjapaneseJSONroute53dependency managerRFC-6455circularnamepropertystylesclassnamecurlObservableswidthprettymatchestslibstylinglocationutilityworkspace:*deep-copychaies6cloudwatchio-tsdatastructuredateArray.prototype.findLastIndexcallboundnamesStyleSheetpasswordnumberstringsomeisawaitCSSStyleDeclarationMicrosofttesterenumerablequeuecrypttrimLeftartpersistentMapfolderlogginglookcss variableObject.fromEntriesPromiseestreefunctionwhatwgfilterconfigboundl10nmiddlewarefastifyfullmixinsfigletreducegetcolorrdsqueryes5stableObject.keyspnpm9Streamsless compilerloggerphonematchECMAScript 7bootstrap cssdynamodbURLArrayBufferwrapstateless.jsreadableeslint-pluginInt8ArrayBigInt64ArraygetOwnPropertyDescriptorendpointvpctypeerrorintrinsic$.extendtaskunicodeformeslintconfigqsawsrfc4122reuseuninstallproxytc39airbnbelectronfetchglacierkeysgetoptArrayBuffer.prototype.slicelimitedtoSortedwgettoobjectlockfileslicesidecolouriterationcode pointsconcurrencysymlinksqueueMicrotaskless cssvaluesaccessor.envquoteconcatformatvalidatemovehttpscloudsearchprototype[[Prototype]]entriesfindmkdirsPushdeepbeanstalkmapcsscompilersharediamequalityhottypedwafec2internal slotgetintrinsicstringifynpmmobileflattenjasminefast-copypathString.prototype.matchAllweakmapvalidationhookformdescriptionruntimepredictablermtestcryptoArrayencryptionemrcloudformationpatchoptimist
1.1.29

11 months ago

1.1.28

12 months ago

1.1.30

11 months ago

1.1.19

12 months ago

1.1.18

12 months ago

1.1.17

12 months ago

1.1.23

12 months ago

1.1.22

12 months ago

1.1.21

12 months ago

1.1.20

12 months ago

1.1.27

12 months ago

1.1.26

12 months ago

1.1.25

12 months ago

1.1.24

12 months ago

1.1.16

12 months ago

1.1.12

12 months ago

1.1.15

12 months ago

1.1.14

12 months ago

1.1.13

12 months ago

1.0.12

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago