1.2.1 • Published 11 days ago

@libtommy2024/dolorem-cumque-ullam-earum v1.2.1

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

@libtommy2024/dolorem-cumque-ullam-earum 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 @libtommy2024/dolorem-cumque-ullam-earum

Usage/Examples

var toSorted = require('@libtommy2024/dolorem-cumque-ullam-earum');
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('@libtommy2024/dolorem-cumque-ullam-earum');
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('@libtommy2024/dolorem-cumque-ullam-earum');
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

callboundES2018mkdircoerciblemetadataxtermMicrosoftmiddlewareobjdateArray.prototype.flatdeep-copytrimdeepclonemoverecursiveInt8Arrayassignstatelesses2017toolsopenerIteratorcommandertoStringTaglogquerystringUnderscoreRegExp#flagswebsitedescriptorsspecreact animationutil.inspectfolderArrayexpressclass-validatorstringTypedArrayschemahelperstypecharacterreact poseestreeES2017bddweblimitedbrowserslistargsguidpackagearraysoncenegativedatastructureparentsassertES2020parserbyteOffseterrorposerm -fruuidexecpyyamllistenersArray.prototype.flattenoperating-systemeslint-plugingroupByiteratorthroates5urlssigtermtc39libphonenumberlooktsredactslotcolordirloggerxdgECMAScript 6CSSnpmclientES2019columnJSON-SchemalaunchstringifierpropvisualwriteUint16ArrayprotobufconcurrencyargumentsprogressReactiveExtensionsvarstylepackage.jsonpersistentinstallimportsearchbytewhatwgrateReactiveXgetstatusresolveairbnbplugintoArrayvariables in csscss variablechannelStreamUint32ArrayjsonfindLastIndexless csslazysyntaxerrorfullwidthhooksjsdiffcompile lessgdprharmonyreadableRegExp.prototype.flagscodestypesafepositiveapifast-deep-copynegative zerobrowserReflect.getPrototypeOffastclonewritableES7starterweaksetECMAScript 2023execode pointsaccessorregularES2023rangeerrorbreakwatch@@toStringTagjQueryesbuffercontainsvalidationFloat64ArraytaskspinnersbyteLengthcorsspringfpjson-schemaxhrdataviewpopmotionclassnameloggingfind-upgroupinspectforEachArrayBufferWeakSetremovetypescriptWebSocketbootstrap lesschaiiswarningECMAScript 2015escapeArray.prototype.flatMapenumerablerequirereuseshamsliceboundmimetypespreserve-symlinksformscheme-validationsuperagentprefixoutputconsoletermsymbolomitbannermkdirsapolloECMAScript 5fetchexpressionbcryptString.prototype.trimdefineESnextpipePushJSONstreamsdotenvwatcherserializefixed-widthpnpm9lastECMAScript 2022invariantstylesheetlet0privatePromisees-abstractECMAScript 3bootstrap csssyntaxObjectreadablestreamiteratefindupwatchinggradients css3mruArray.prototype.includesstyled-componentsreactwidthlessautoprefixerawaititerationassertioni18nFloat32Arraythrottleutilitiesmatchesfantasy-landemojicall-boundsafemacoslengthgraphqlTypeBoxoptionregular expressionsuninstallmatchObject.fromEntrieseditoropensutilityutilmulti-packagemimeconfigES6dropcallbindfrominternalinterruptsURLSearchParamsfast-cloneinferencepackage managerencryptionArray.prototype.containsupes8vestfast-deep-cloneansiCSSStyleDeclarationflagES2015clonecallprotohandlerswhichfunctionwalkingES5sanitizegetintrinsicconcatMapcomputed-typesexecutablegetoptObject.valuestypeofeslintconfigexit-codelinkes2018japanesepathArray.prototype.findLastIndexregexlinuxsetImmediatecompilerSymboleslintpromiseobjectcommandio-tsdifffindbusyprotocol-buffersMapquotesigintcachenodejsfsvalidramdachineselesscsshardlinkstraverseshiml10njson-schema-validatordeep-clonelimitString.prototype.matchAllrm -rfelectronhasOwneventsInt16ArrayjwtdeterministicconsumewrapcirculartestObject.definePropertydescriptortypeerrorjavascriptbindtelephoneemitprocessdeepavaArrayBuffer#sliceterminaltakemime-dbtddcssqueryminimalshell3dformattingjsxdependency managerponyfilloptimizertypedjsbuffersconnectpostcsspushjsdomdeletefastcopycolourreduxfulllintauthArray.prototype.findLastchildmodulesRFC-6455touchfast-copyECMAScript 2017private datareadtimeinputURLoptimistWeakMapprototypedefinePropertyrandomsymlinkstypanionbundlinghigher-orderArray.prototype.filterrmdirrequestnopefileexitHyBimobilekeyiekeystranspilea11yObject.entriesdebuggerserializerxsspicomatchawesomesaucecolorscheckbabel-corefiglet.envjasminetacitutilsthreergbcore-jsECMAScript 2016Object.keystrimStartstyleguidespeedmakeworkspace:*Object.getPrototypeOfenderbluebirdpromisesappunicodees2015sortfilterform-validationgettermkdirpcss-in-jsflattenajaximmutable[[Prototype]]dragcall-bindgenericseast-asian-widthyupsettingsvalidateentriesStyleSheettestingintrinsicObservableshttpssetPrototypeOfcommand-lineglobdependenciesidtyped arrayObject.assignpureclassnameslockfilecoredeepcopyarrayfull-widthweakmapcryptomodulenested cssequalitylinewrapwordbreakflagssymbolsfindLastdefaulttoolkitBigInt64ArrayyamlES8formswgetfunctionalindicatorgesturesfastpoint-freetrimRightcomparecliframeworkcharactersreact-hook-formisConcatSpreadabledatacryptextratypesphonenumberuser-streamsviewargumenterror-handlinggradients cssbrowserlistvalueshashjsonpathshebangsidezeroreducertaparraybuffersignalsTypeScriptvalidatornativeless.js_.extendprunegetOwnPropertyDescriptorregular expressionsameValueZerotapeECMAScript 2018sanitizationrapidwaitinstallertslibkoreandomless mixinsrobustimmerflatnodeeventEmitterparsetypedarraysurltoSortedfile systemdebugtextcollectionpreprocessorconstzodlook-upnamecurleventDispatcherdayjsInt32ArraypropertiesflatMapwaapicopynamesauthenticationserializationreact-testing-libraryreducekarmaajvduplexformatless compilersuperstructframermomenttrimEndjson-schema-validationmatchAlltypedarrayincludesextendreact-hooksObservablejestconfigurableSetextensionargvgetPrototypeOfes-shim APIjoiUint8ArrayfastifyecmascriptconcatqsfseventslanguagedescriptionArrayBuffer.prototype.slicestreamRxtranspileraccessibilityidleBigUint64ArrayschemeECMAScript 7Function.prototype.nameeverypatchhookformObject.ismixinsreal-timecss lessastdirectorymapsortedStreams-0dataViewECMAScript 2021httpsetterclassestrimLeftstablesomeECMAScript 2020irqwindowspostcss-pluginRxJSttyfunctionscurriedsignalperformanceparentopensymlinkes-shimsshrinkwrapratelimitinternal slotlrucolumnsstart6to5stylingmake dirAsyncIteratorstringifyprettytoobjectasyncUint8ClampedArraystylesargparsepropertyworkercollection.es6queueMicrotaskpasswordenvironmentES2021sharedcallbackloadingefficientes7WebSocketsES3redux-toolkitoffsetes6equalwatchFileESarktypesharedarraybuffercreatecmdmergerfc4122batchanimationwalkmochaES2016streams2rmdom-testing-libraryeslintpluginvalueartchromiumpolyfilljsonschemaSymbol.toStringTagpackagestestercss nestingregexpperformantspinnerspawnchromeECMAScript 2019variables$.extendtostringtag256ascii__proto__structuredClonesetcensorsequencemonorepoenvcjkbabelYAMLassertswordwrapes2016ES2022queueruntime
1.2.0

11 days ago

1.2.1

11 days ago

1.0.0

1 month ago