1.0.0 • Published 1 year ago

@rabiepenpm/consequatur-earum-molestiae v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@rabiepenpm/consequatur-earum-molestiae Version Badge

github actions coverage License Downloads

npm badge

Array.prototype.concat, but made safe by ignoring Symbol.isConcatSpreadable

Getting started

npm install --save @rabiepenpm/consequatur-earum-molestiae

Usage/Examples

var safeConcat = require('@rabiepenpm/consequatur-earum-molestiae');
var assert = require('assert');

assert.deepEqual([].concat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with normal concat');
assert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'arrays spread as expected with safe concat');

String.prototype[Symbol.isConcatSpreadable] = true;
assert.deepEqual([].concat('foo', Object('bar')), ['foo', 'b', 'a', 'r'], 'spreadable String objects are spread with normal concat!!!');
assert.deepEqual(safeConcat('foo', Object('bar')), ['foo', Object('bar')], 'spreadable String objects are not spread with safe concat');

Array.prototype[Symbol.isConcatSpreadable] = false;
assert.deepEqual([].concat([1, 2], 3, [[4]]), [[], [1, 2], 3, [[4]]], 'non-concat-spreadable arrays do not spread with normal concat!!!');
assert.deepEqual(safeConcat([1, 2], 3, [[4]]), [1, 2, 3, [4]], 'non-concat-spreadable arrays still spread with safe concat');

Tests

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

concurrencyvariablesjson-schematypecallboundwatchFiletypedarraysreadablestreamFloat64ArraylruiterationtrimStartwindowsvalidwalkingECMAScript 7filesafeprivate dataserializationuninstallPushArray.prototype.flatpasswordes2016validationES2021CSSStyleDeclarationbuffersES3spinnerObject.definePropertyStreamdebugtypesBigUint64Arraycloneslotarraywarningresolveglobless csstoSortedtakeinvariantfastcopyyamlbyteOffsetsymlinksmoduleeventEmitterlimitedgdprpolyfillinputsyntaxES2017httpquerystringmonoreporequestclient__proto__setbabellookIteratormapiteratorharmonystreamsTypeScriptcommandkeysjson-schema-validatortraverseopenapiwatchless mixinsdatafastclonenamesSymbol.toStringTagidleargskarmaargvArray.prototype.filteraccessibilitydeepcopyprotocol-buffersawaitArrayBuffer.prototype.slicedependenciesjestclass-validatorclassnamescallbackmomentjsbannerwhichless.jschannelinferenceformsextrarm -frstableform-validationUint32ArraydomencryptionperformantECMAScript 2016formathelpersArray.prototype.flatMapFunction.prototype.name3dECMAScript 2021workerdefinePropertywaapiInt16ArrayeslintassertionsidebcryptgetOwnPropertyDescriptorpopmotioncompile lessredactStyleSheetReactiveExtensionsexpressObject.keystapruntimeexpressionboundflatlintgraphqlnegativepackagesassertsconcatMapprotobufspecargparseio-tsdotenvbundlerspringbrowserarktypeRegExp#flagsdayjshascssletutil.inspecttestingposextermtoStringTagindicatorbootstrap csslengthbytechinesecheckcopypackage.jsonworkspace:*MapjavascriptECMAScript 2019installwgetES2015metadataflagsformECMAScript 2020stylegradients css30phonemimetypesfast-deep-copyES2019validateconnectcorslockfiletoArrayreduxvisualtrimEndnodePromiseReflect.getPrototypeOfshebanggetoptes5nopeuser-streamspreserve-symlinkstestlinuxurllessdirectoryObject.entries@@toStringTagbddoptionpackage managerObject.is6to5call-bindcreatefunctionkoreanemitrmdirequalityRxYAMLprivateartisvalidatorESjsxpathshrinkwrapiterateArray.prototype.containsreact-hook-formvestrecursivedeletemimelinkgradients cssRFC-6455threematchmakees2015less compilerreact animationtoolshooksbootstrap lessstringifyinternal slotchaijsonschematddcallES2018fast-cloneasyncanimationframeworkinternalmixinsdeep-cloneequalcollectionenvarraybuffertc39ES7awesomesaucehookformlogoffsetloggingRegExp.prototype.flagsMicrosoftexit-codeconstargumenttostringtagwebguidforEachprototypefromasttyped arrayBigInt64Arrayrgbmake dirObservablesfindserializerfile systemqueueMicrotaskformattingUint8ClampedArraycolumnsdropterminalsigintjsonpathdeepwriteES2016cjkbrowserslistESnextString.prototype.trimecmascriptECMAScript 2017colourextendcharacterstoolkitsignalcoerciblesymbolsnamewaitimportpipedragweaksetratelimitgetintrinsicjsdomlimitES5censorbufferObject.assignfsstringObject.fromEntriessortmacosObject.valuesfetchrma11yassigncodesschemewatcherbyteLengthajaxprotoajvthroatwrapFloat32Arrayreal-timegroupBydataViewCSSestreestatelessdirsignalsi18nfull-widthextensionbundlingzodbabel-corerapidcurlreadtelephonetoobjectArrayBuffer#sliceconsumeES8deep-copyhashwritabledeterministic
1.0.0

1 year ago