1.0.0 • Published 1 year ago

@skylernpm/ad-distinctio-tempore v1.0.0

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

@skylernpm/ad-distinctio-tempore Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES5 mostly-spec-compliant Object.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/ad-distinctio-tempore');
var assert = require('assert');

assert.equal(getPrototypeOf(true), Boolean.prototype);
assert.equal(getPrototypeOf(42), Number.prototype);
assert.equal(getPrototypeOf(''), String.prototype);
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/ad-distinctio-tempore');
var assert = require('assert');
/* when Object.getPrototypeOf is not present */
delete Object.getPrototypeOf;
var shimmed = getPrototypeOf.shim();
assert.equal(shimmed, getPrototypeOf.getPolyfill());

assert.equal(Object.getPrototypeOf(true), Boolean.prototype);
assert.equal(Object.getPrototypeOf(42), Number.prototype);
assert.equal(Object.getPrototypeOf(''), String.prototype);
assert.equal(Object.getPrototypeOf(/a/g), RegExp.prototype);
assert.equal(Object.getPrototypeOf(new Date()), Date.prototype);
assert.equal(Object.getPrototypeOf(function () {}), Function.prototype);
assert.equal(Object.getPrototypeOf([]), Array.prototype);
assert.equal(Object.getPrototypeOf({}), Object.prototype);
var getPrototypeOf = require('@skylernpm/ad-distinctio-tempore');
var assert = require('assert');
/* when Object.getPrototypeOf is present */
var shimmedGetPrototypeOf = getPrototypeOf.shim();
assert.equal(shimmedGetPrototypeOf, Object.getPrototypeOf);
assert.equal(Object.getPrototypeOf([]), Array.prototype);

Tests

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

filterbindwalkingObject.keyscompilerWeakSetgetintrinsicjestfetchmovecssagentfseventsflattenrestfulextraUnderscoremakejsdiffquoteentriesArray.prototype.findLastIndexpreserve-symlinksworkflowES6npmredux-toolkitECMAScript 2016styleguidefolderpipestreams2yupeventstostringtagwatchFilerestbluebirdargvaccessibilityliveES2018urlidargsmruWeakMapnameuuidtypanionECMAScript 2017hotfastglacierjsonpathcode pointselbebsloadingstylesheetroutingECMAScript 2018es5deepclonewraprandomgetPrototypeOftoStringTagworker256copypackage.jsonjsonexpressECMAScript 2015mimesnsconsumeFunction.prototype.namedirbundlernamesimportexportchaiparentwalkStyleSheetjoisequencehashashfunctionsObject.entriesnested cssbyteLengthfast-copyObject.isiscollection0ES2022prettyidleforEachreactspechigher-orderbyteOffsetrmArray.prototype.filterjsdomBigInt64Arrayhandlersscheme-validationUint8ArrayString.prototype.matchAllvalidatepositiveprototypeshamReactiveExtensionscolourfindcirculartapemiddlewaredescriptorsreact-hook-formqsInt8ArraysameValueZeroconnectES7RFC-6455whichsetPrototypeOfsortefficientless compilerarraybuffercryptemitmake dirsharedarraybuffermergepreprocessorwatchingTypeBoxutilgetOwnPropertyDescriptorWebSocketssyntaxerrortsdeepcopyStreamslinkreact-hooksfastcopyloadbalancingsetwriteArrayBuffer#slicevpcshimES2020toArrayECMAScript 6requireinstallgetboundsymbolscallbindaccessorviewruntimecoreelmasynchttpsendergdprmochaprivate dataObject.getPrototypeOfobjecttypedArrayBuffer.prototype.slicequeueMicrotaskhas-ownpostcss-plugindataeventEmitterfastifyes-shim APIslotbeanstalktypesendpointiamfullwidthwatchersignalloggingmkdirppackagesECMAScript 3deterministicreuseclassnamesenvironmentes6frameworkreact-testing-librarymkdirsomees-abstractzodtoolspasswordsharednumberl10njsxmatchAllbatchArray.prototype.flattenslicepatchconcatMapserializationwafbrowserslistquerystringsearchstyles-0limitedsimpledbarktypeflatargparsees-shimsterminalwindowsauthenticationmulti-packagechineseECMAScript 2020Object.assignESObject.definePropertyconsoleassignthrottlesideeslintpluginlesscssInt16ArraylengthflagsRxJSfluxrecursivenodejsformsvalidationcomputed-typeshasOwnPropertysuperstructArrayBufferimmutableObject.valuesperformanceencryptionloggerinterruptstrimRightbusykoreancharacterperformantmime-dbstyled-componentspyyamlES2015linuxinsetImmediatefindLastinternalemojiRegExp.prototype.flagsmatchessiginttrimEndgenericsdirectorytesterarrayequalityreadablestreamconfigurablegradients csspromiseobjirq$.extendremovedatastructureString.prototype.trimoperating-systemdeep-clonetapcolorphoneES2016fast-deep-clonetc39ownpropjQuerybreakrmdirsuperagentrequestjavascriptcoercibleec2dataviewlessbundlingprivateoptimizercurlInt32ArraystdlibcompareschemafunctionalartPushmonoreposyntaxsettingsmetadataassertsformattingpushlazyprotobufcolumnsxhrenumerableWebSocketrobustCSSwaitfindLastIndextypedarrayAsyncIteratorpackagewatchcloudfrontexecbootstrap csseast-asian-widthnopeelectronclonenativegroupBychanneldayjsoptionshebangfastcloneStreamECMAScript 2023util.inspectcall-bindless.jsrapidajvescapewarningchromepropertiescall-boundclass-validatorargumentes7arraysbannercodesclies2017timefromSetdiffbytees2018elasticachecss-in-jsstringifierIteratortoSortedES8mapswfbrowsercollection.es6es2015utilitiesdefinePropertycolorssetterairbnbstablemimetypesdataViewSymbol.toStringTagwidthserializeropenJSONassertiontakeenvshrinkwrapchromiumrdstoolkitbrowserlistjsformatcallboundhardlinkses2016bufferstermRxeslintconfigconfigio-tsautoprefixerObservablesnodedom-testing-libraryflagiereadreducerECMAScript 7libphonenumber__proto__ES2019findupzerocheckrouteconcurrencyunicodesqsBigUint64Arrayduplextasktypehttpeslint-pluginECMAScript 2021dropconcatReactiveXsymbolserializefpsArray.prototype.flat[[Prototype]]spinnerwritableregular expressionsinspectflatMaplistenersdatejasminestoragegatewayregular expressionqueryeslintdeep-copyerrortoobjecttelephonemacoscore-jsbufferinvariantexitauthregexparsesortedreducepolyfillincludesdeleteexit-codecommand-lineECMAScript 2022eventDispatcherlintcallbackcontainshasOwnminimalcallreplayprefixcss lesscloudwatchpackage managerawesomesauceES5ecmascriptlastcolumncjkoptimist.envRegExp#flagsbootstrap lessfull-widthArray.prototype.containstraverseerror-handlingFloat64ArrayReflect.getPrototypeOfrouterfigletroute53typescriptpathcensorcloudsearchvariablesdebuggermkdirsArray.prototype.flatMapES3regularweakmaplook-upESnexttypeofpersistentiterateObservableshelldependenciesvaluesless cssresolvextermawslockfilenegativeutilitydefinecloudformationbcryptcss nestinginstallerfile systemtrimStartguidstringifyJSON-SchemaparsingcreatedomweaksetregexphooksexpressionastmixinslimitvisualCSSStyleDeclarationless mixinsworkspace:*ttykeysoffsettyped arraystatelessdebugimportiterationawaitcachetypeerrorpruneprotomoduleSymbolascii
1.0.0

1 year ago