1.0.0 • Published 1 year ago

@skylernpm/nesciunt-corporis-provident v1.0.0

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

@skylernpm/nesciunt-corporis-provident 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('@skylernpm/nesciunt-corporis-provident');
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('@skylernpm/nesciunt-corporis-provident');
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('@skylernpm/nesciunt-corporis-provident');
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

Object.fromEntriesyamlconcurrencycirculardatastructuredotenvgradients cssfluxwhichloadingBigUint64Arraymake dirpostcsscallbindrobustmobileenvironmentECMAScript 2018fixed-widthlistenersparsethrottletypewatchArray.prototype.flattengetPrototypeOfconcatMapbyteLengthdatatraversebusysignalsjapaneseslotES5setImmediateresolvestdlibupnativeiecore-js.envpicomatchcss-in-jsl10nURLvalidtc39Float64ArrayES6tapdefineartutilitiesredux-toolkitpropertiescheckio-tsparentstoolkitparsingArray.prototype.containsflagsUint8ArrayawaittimeSymbolsidecomparedom-testing-librarystreamsdataViewstylesfolderECMAScript 7flattensharedarraybufferkeycall-bindcompile lessfindupargvform-validationentriesqueryoptimizerwebjsdomroutermiddlewareuninstallcallbackRegExp.prototype.flagsformslinklruschemadiffroute53unicodetostringtagcolumnjwteventDispatcherassertairbnbSymbol.toStringTagvpcvisualinternal slotfsdynamodbdependency managerES2018readablestream$.extendbundlingFloat32ArraysameValueZeronodejsboundmacoseventshas-ownCSSwalksortinferenceweaksettypedarraysigtermaccessibilityURLSearchParamscode pointsphonestyleguideesnamesreact-hooksreadtestercall-boundUnderscorettygradients css3ajaxlesspathArray.prototype.findLastIndexautoscalingIteratorwgetelectrontddes8typanionisJSON-Schemainternalterminales-abstract256privatepackagesidrangeerrorjsdiffAsyncIteratorfind-upMapECMAScript 3colortextcontainsloggerflatMapargumenthasOwnPropertylanguagebufferimmerfunctionsrapidarraysYAMLnameprocesscloudsearchpredictableaccessorObservablesdebugperformanceArrayBufferprogressexpressStreamsHyBibootstrap lessfast-copystoragegatewayhandlersbannerargparsehelperswatchingsearchES2023regexpchaicompilerzeroprotostylesheetshrinkwrapa11ylinuxloggingObject.assignconfigurableES2019trimEndes2015removesymlinkdeep-copyString.prototype.trimcallboundtrimRightReflect.getPrototypeOfmixinsES7variablesObject.valuesRxJSelbroutingfastextendprunehasdefinePropertystyled-componentsweakmapdeletepluginwarningpolyfilltypedarraystermhashcommandcachevaluenopeStyleSheetomitcolumnsmimetypesapiecmascriptguidcloudfrontclassesdescriptorJSONerrorforEachinterruptsavacloneobjectfull-widthpushReactiveExtensionsspecisConcatSpreadableESnextes2016watchFileenumerableregular expressionsmomentpreprocessorpipeasynchigher-orderconfigthroatchromiumquerystringreducerinputcollectionestreecreatedescriptorsUint32ArraynegativejasminecharacterimportexporttoolsoncetestiamglacierrequireObject.isRxshamcss nestingpersistentmochacensorsignalpackage managermetadatapostcss-pluginprettycoreexpressionfast-deep-copyfetchArrayBuffer.prototype.slicehookformTypedArrayeveryhotsortedimportwidthpyyamlPushxhrbddeslint-plugineslinthttpsassertsbootstrap cssimmutableflagmatches5buffersmonorepotyped-0shimgroupwordwrapauthenticationsharedArray.prototype.findLastclassnamebreakcollection.es6browserreact-testing-libraryless csstyped arrayeventEmitterES2021viewexittrimLeftmovepropertytouchES8typesafeES2015regular expressionregexvestdeeptypescriptObservablezodponyfillregularhasOwnfseventsgetoptworkerStreamjavascriptES2016xtermgetterInt16Array[[Prototype]]mkdirfast-clonepreserve-symlinksless compilerprotobufruntimecjkgroupByutilrmdirstateWeakSetrmdependenciesreuseurlsettingsarraychannelperformantkarmarestliverandomes2017mapreduceerror-handlingfile systemec2stringifywatchernested cssassertionArrayArray.prototype.includeslastcallECMAScript 2015util.inspectcommanderdirectoryminimalECMAScript 6genericsswflimitedRFC-6455writefastcloneclass-validatorfilterInt32Array_.extendECMAScript 2020cryptcodeslook-upspinnerspackage.jsonidlequotecomputed-typesreduceequalcurlsetterwordbreakdayjspackagepasswordcommand-linefastifynpmawstypeerrorrgbdomfunctionstreams2joichineselesscssrm -frstarterlazyfpsprotocol-buffersdebuggeropenmodulevalidatewhatwgSetownTypeScriptgetOwnPropertyDescriptormimeebsqueueMicrotaskECMAScript 2016awesomesaucedataviewkoreancloudwatchBigInt64ArrayirqWebSocketwrapagentextraglobshellreadablees6cssless mixins@@toStringTagECMAScript 2022mkdirssqsautoprefixerfileconnectsesendpointreal-timevaluesspinnercryptoArrayBuffer#sliceiteratordeterministicstablewalkinghookstslibrequeststylereactwindowslooksetsymbolbindwafsymlinkselasticachepositiveTypeBoxbrowserlistfindLastIndexintrinsicMicrosoftbrowserslistfunctionalnegative zerowritabletoStringTageslintpluginlengthbundlersafesuperstruct
1.0.0

1 year ago