1.0.0 • Published 12 days ago

@f1stnpm2/ipsa-repellendus-expedita v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 days ago

@f1stnpm2/ipsa-repellendus-expedita Version Badge

dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.toSorted shim/polyfill/replacement that works as far down as ES3.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the proposed spec.

Because Array.prototype.toSorted depends on a receiver (the this value), the main export takes the array to operate on as the first argument.

Getting started

npm install --save @f1stnpm2/ipsa-repellendus-expedita

Usage/Examples

var toSorted = require('@f1stnpm2/ipsa-repellendus-expedita');
var assert = require('assert');

var input = [5, 4, 3, 2, 1, 0];

var output = toSorted(input);

assert.deepEqual(output, [0, 1, 2, 3, 4, 5]);
assert.notEqual(output, input);
assert.deepEqual(input, [5, 4, 3, 2, 1, 0]);
var toSorted = require('@f1stnpm2/ipsa-repellendus-expedita');
var assert = require('assert');
/* when Array#toSorted is not present */
delete Array.prototype.toSorted;
var shimmed = toSorted.shim();

assert.equal(shimmed, toSorted.getPolyfill());
assert.deepEqual(input.toSorted(), toSorted(input));
var toSorted = require('@f1stnpm2/ipsa-repellendus-expedita');
var assert = require('assert');
/* when Array#toSorted is present */
var shimmed = toSorted.shim();

assert.equal(shimmed, Array.prototype.toSorted);
assert.deepEqual(input.toSorted(), toSorted(input));

Tests

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

collection.es6descriptionnodejsshellsanitizationl10nponyfillfastifybytesetcreateclijsonschemaoptimizerECMAScript 20233dwatchstylinggetPrototypeOfincludesreduxutilnopetddhooksformauthnegative zerobcryptarraysstylestapObject.fromEntriescallboundbabel-coreprefixstreams2fppropertieswaitReactiveExtensionsarraybufferfind-uphardlinksmobilesetterwhatwgstringargparseimmerWebSocketbddbatchgradients css3i18nargvwrapwhichfetchWeakMapnamesprettytrimEndstringifiershrinkwrapArray.prototype.findLastvarspeedECMAScript 2020css-in-jsfindupuuidutilssameValueZerocoercibleyamltimeES2022recursivenameArraymake dirkarmafiglettypescriptreusereact-testing-libraryasyncmomentlook-upES2019inferenceinstallsequenceupsymbolfunctionspackageURLSearchParamsWebSocketsqueryString.prototype.trimFunction.prototype.namesymlinkpicomatchfixed-widthweaksetECMAScript 2015writablemapexecutablerangeerrorTypedArrayforEachfastcopyartStreamsassertsObjecttypeapollo256compile lessStreamoptimistsyntaxerrorconcurrencyes2017syntaxschemamoduleredactequalcss lessformattinghasxhrargumentES3shebanglastUint8ArraywidthdependenciesworkerdragRxJSsymbolsloadinggetintrinsicrgbdeep-copysortedvalueES2018CSSObject.valuesindicatorthroatopenerpluginECMAScript 2018file systemlookthrottleArray.prototype.flatMapTypeBoxpureArray.prototype.containsurlscheckletmixinsbootstrap lesswordbreakcall-bindoutputloglaunchJSONtelephoneflatbabelES2020gradients csssharedbyteLengthhigher-orderreact animationecmascriptprototypeECMAScript 7idleRFC-6455eslintavaexitinvariantsomeArray.prototype.includesestreeReactiveXconcatconstexpressionviewiteratorregularrfc4122statuszodoperating-systemdatelazyregular expressionisConcatSpreadablebrowserslistremoveString.prototype.matchAllio-tsspawnequalityES2015walkingwatchFilepostcssArray.prototype.flattenprogressstartutilitiesInt32ArrayObject.entriessigtermfilemacosshamjsdifftapeBigUint64ArrayUint32ArraycollectiondayjskeyvesttextdropasciiirqReflect.getPrototypeOfeslint-pluginflagexpressfast-clonecorsappdebuggerwritetypeerrores-shim APIPushinstallerfullECMAScript 2022ECMAScript 2021package managerlrujsonfantasy-landstylesheetenderform-validationhandlersdefinerateInt16ArrayObservablesstdlibsymlinksprotoFloat64ArraypersistentconnectcompilertacitcmdECMAScript 5serializereact poseimportObject.keysflagsdescriptorsmkdirpPromiseclientbundlerhookformjwtassertCSSStyleDeclarationapibindtestdeterministicquerystringreduceWeakSetpreserve-symlinksassertionuninstalleventEmitterESjestpushsharedarraybuffernodejavascriptcsszerospinnermkdirsunicodewordwraptesterchildInt8ArrayintrinsicievalidatetoSortedstyleguidewatcheres5queueArray.prototype.flatjapaneseextensionargstostringtagtranspileregular expressionspropgraphql6to5configfunctionalthreeqsimmutableexeredux-toolkitprunetrimStartanimationArray.prototype.filtercss nestingtoArrayArrayBuffer.prototype.slicepropertytypedarraylibphonenumberSymbolspinners
1.0.0

12 days ago