1.0.0 • Published 13 days ago

@rabiepenpm/quis-nulla-expedita v1.0.0

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

@rabiepenpm/quis-nulla-expedita Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2015 mostly-spec-compliant Reflect.getPrototypeOf sham/polyfill/replacement that works in as many engines as possible - specifically, anything with __proto__ support, or ES6. Built-in types will also work correctly in older engines.

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

Example

var getPrototypeOf = require('@rabiepenpm/quis-nulla-expedita');
var assert = require('assert');

assert.throws(() => getPrototypeOf(true));
assert.throws(() => getPrototypeOf(42));
assert.throws(() => getPrototypeOf(''));
assert.equal(getPrototypeOf(/a/g), RegExp.prototype);
assert.equal(getPrototypeOf(new Date()), Date.prototype);
assert.equal(getPrototypeOf(function () {}), Function.prototype);
assert.equal(getPrototypeOf([]), Array.prototype);
assert.equal(getPrototypeOf({}), Object.prototype);
var getPrototypeOf = require('@rabiepenpm/quis-nulla-expedita');
var assert = require('assert');
/* when Reflect or Reflect.getPrototypeOf is not present */
if (typeof Reflect === 'object') { delete Reflect.getPrototypeOf; }
delete globalThis.Reflect;
var shimmed = getPrototypeOf.shim();
assert.equal(shimmed, getPrototypeOf.getPolyfill());

assert.throws(() => Reflect.getPrototypeOf(true));
assert.throws(() => Reflect.getPrototypeOf(42));
assert.throws(() => Reflect.getPrototypeOf(''));
assert.equal(Reflect.getPrototypeOf(/a/g), RegExp.prototype);
assert.equal(Reflect.getPrototypeOf(new Date()), Date.prototype);
assert.equal(Reflect.getPrototypeOf(function () {}), Function.prototype);
assert.equal(Reflect.getPrototypeOf([]), Array.prototype);
assert.equal(Reflect.getPrototypeOf({}), Object.prototype);
var getPrototypeOf = require('@rabiepenpm/quis-nulla-expedita');
var assert = require('assert');
/* when Reflect.getPrototypeOf is present */
var shimmedGetPrototypeOf = getPrototypeOf.shim();
assert.equal(shimmedGetPrototypeOf, Reflect.getPrototypeOf);
assert.equal(Reflect.getPrototypeOf([]), Array.prototype);

Tests

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

everynegativetc39ECMAScript 2019nested cssES2019avadraglistenersfunctionalstreams2datastructureflatMapcallexpressionupinvariantframeromitcore-jsiterationoperating-systemspawnxssqsexeutilposedefinemacosrandomRxJSjapanesecurriedequalitywatcherinputfast-deep-copytypedarraysflagdeletejsdomtaskpreprocessorsymbolsawesomesauceextensionlibphonenumberprogresscompareentriesvalidstatelessarttrimRightwordbreakgetlinewrapbootstrap cssfpdiffperformantURLprotocol-buffersasteslintpluginsettingsObject.valueses-shimsmatchAllstyleless csseditorArray.prototype.containsassertinstallmochahttpnopecomputed-typesspinnersfastclonephonepluginvalidationURLSearchParamsterminalobjdescriptorexecutablechannelarraybufferfseventseast-asian-widthwatchFilegetOwnPropertyDescriptorpackage managerWebSocketfastifypersistenterror-handlingcensorproptypanionyamlfindupsharedObject.getPrototypeOfArray.prototype.findLastIndexfilterECMAScript 3whichserializerqueueMicrotaskoptimistfile systemlazyissortedenvironmentcodesuuidreactrangeerrordependency manageres-abstractES2023nativeCSSdeepclonetapObservablesreadhelpersfilebcryptobjectpicomatchwalkingstarterweakmapmatchformstoArraydefaultjoihandlerses2017breakmergeletlinuxcss variablevarless mixinshasexit-codenodejsassertssignalsaccessibilitycreatecompile lessinstallerfast-copy.envhashtacitcommandcacheclientUint8ClampedArrayRegExp.prototype.flagschromemkdirrm -fri18ndeepcopyunicodeeslint-pluginsetStreamqueueramdakoreantestforEachsetImmediatejsonpathajaxfunctionxdgreact-hook-formrm -rfexitreducevestwritablefast-cloneUnderscorefantasy-landwhatwgECMAScript 2016deterministicconsttddreact-hookslimitbrowserslistslotstartarraysapollopushReactiveExtensionsopens__proto__findLastIndexpostcssmodulechildinspectdommodulesFloat64Arrayshammiddlewarebluebirdmkdirs_.extendArrayjsonschemabyteLengthwindowstrimEndhookformsearchschemejson-schema-validationstyleguideObject.definePropertylanguageparserreuseUint8ArraysymbolcallbackstringESserializewalkvariables in csspoint-freeES8setterECMAScript 2018speedeslintconfigindicatormapdirectoryminimalutilityless.jsefficientreadablestreamregularHyBicolumnstypedarrayconfigurablejasmineworkerJSONreact posepostcss-pluginReactiveXassigniteratorform-validationes2018ES3tostringtagCSSStyleDeclarationinternal slotframeworkopenguidString.prototype.trimanimationfullwidthES7variablesbootstrap lessfunctionsmrukeyttypureprivate databundlerautoprefixerdayjsECMAScript 2023logdescriptionutilsconcatMapjQueryirqarktypeidleloadingemiterrortyped arrayduplexgradients css3webwatchObject.fromEntriescss-in-jsWebSocketssortprotoxhrTypeBoxxdg-openstringifycsspipemulti-packageMapeslinkTypeScriptpreserve-symlinksBigInt64ArrayeventEmittertrimStartimportgetterconfigMicrosoftschemafrombrowserlistkarmaargumentpyyamlfoldermimeremoveUint16Arrayextrarmpnpm9optionyupcloneregular expressionclassnametypewebsitedataincludeslinthardlinkses5groupBydebugeventsparentredux-toolkitconcurrencyvalidatorscheme-validationECMAScript 2017openerTypedArraycorenamesparseside0class-validatorurlgesturesvisualfullcode pointsdropcall-boundapistreamscopycallbindstatuses7Array.prototype.flattenendersymlinkcss nestingsyntaxerrorbuffersES6ECMAScript 2015String.prototype.matchAllcolorsiterateoncechromiumStreamsdataviewsuperagentrobustprefixlook-upenvtypescriptfast-deep-cloneflagsPushasciimetadataintrinsiccryptobatchtypeerrorprotobufansigradients cssargparsemomenttranspilerYAMLpositivebddrequireuser-streamsbrowsersameValueZerodependenciesnodewriteformrecursivetouchredactexpressinferencegetPrototypeOfratetapeArrayBufferzerosequenceArray.prototype.includesgenericsfastIteratorlastdotenvruntimemovestylesthroatcolorpatchmimetypesJSON-SchemaformattranspilequerysomeES2022stylesheetregular expressionsdescriptorsECMAScript 2022threeArrayBuffer.prototype.slicequerystringloggerPromisesetPrototypeOfcss lesscompilerrequestbannerboundperformanceajvrfc4122fastcopycoercibleemojipackageES2018validatees8timeFunction.prototype.namehttpsregextermlimitedsigtermsliceES2015l10nmatchesbusyidwarningObject.assignimmutablesignaldataViewstreambabeloptimizerpropertiesjavascriptestreeBigUint64Arrayfixed-widthconsolecontainspasswordkeysargsUint32ArraychineseInt16ArrayimmernumbersigintstringifierconnectjsdifflesstypeofObservable$.extendtraversemime-dbjson-schema-validatorES2016sharedarraybufferbytesymlinksencryptionsuperstructtelephonejson-0quoteES2017offsetlockfiletrimLeftpromiseescapeasyncpackage.jsonauthenticationfigleteventDispatcherwaapihasOwnfindnpmdefinePropertycollection.es6awaitcliisConcatSpreadablenamedirgraphqlmixinsviewArray.prototype.findLastdeepfind-uplaunchregexpRFC-6455findLastbundlingpolyfilles-shim APIfull-width@@toStringTagdebuggerjsmkdirpsafedom-testing-libraryexectoSortedtypesafestructuredCloneReflect.getPrototypeOfstylingformattingshebangRxFloat32ArrayelectroninterruptsoutputArray.prototype.flatMapWeakSetclassesdeep-copyObject.entriesconcatlook3dless compilerargumentsairbnbbyteOffsetObject.keysSymbol.toStringTagutilitiescmdauthsyntaxtoStringTagiegroupparentswgetjsxjwtcurlrmdirECMAScript 7processzodInt32Arraytslibconsumetypedglobjson-schemachaireact animationwidthgdprspinnerprivatefsclassnamesprettyES2020columnspecxtermflattenequalharmonypackagesargvappRegExp#flagshigher-orderObject.ismonorepotoolkitshrinkwrapcharacterscorsurlstrimhookscollectionES2021valuesweaksetresolvearraygetintrinsicECMAScript 2020styled-componentsWeakMapcjkes2015throttlepruneextendArray.prototype.filterECMAScript 5workspace:*internalObjecteslintArray.prototype.flatmake dirpathserializationcheckshimtoobjectpopmotionponyfillpropertylengthwordwrapassertionwatchinguninstalllrushellratelimitutil.inspectes2016deep-clonecommandercall-bindes6rapidES5babel-core6to5valuesanitizationArrayBuffer#sliceio-tstestersanitizecircularSeta11yreadablegetoptecmascriptpromises
1.0.0

13 days ago