Licence
MIT
Version
1.0.0
Deps
26
Size
17 kB
Vulns
0
Weekly
0
@ryniaubenpm/voluptas-sapiente-numquam 
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('@ryniaubenpm/voluptas-sapiente-numquam');
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('@ryniaubenpm/voluptas-sapiente-numquam');
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('@ryniaubenpm/voluptas-sapiente-numquam');
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
Keywords
lengthreactES8deepcloneexitsymbolsWeakMapnodejsquoteintrinsicstringprocesshasxsssometypedRegExp.prototype.flagseverypackagemrupositivewarninges6es2016URLSearchParamsObject.fromEntrieschromeajaxECMAScript 6toobjecteventEmitterformpureObjectchildpropertiessharedstreamautoprefixerjson-schemaxhres5spinnerslaunchlint0typanionstreams2Int32ArraycontainsrmcalluninstallrapidprotoassertsfastUint16ArrayphonenopeECMAScript 2018valuelazyECMAScript 3typewrapstructuredCloneminimalpackage managerbuffersobjpackage.jsonauthenticationclonedebugerrorwebsiterm -rfObject.assignclassnamescacheAsyncIteratorform-validationlockfileemitjestbluebirdeslint-pluginfinduplinkeditorhelpersdatastructurequerystringtestclassnameECMAScript 2020throatwritableshebanghooksArrayBuffer#slicejsreact-hook-formfromoutputbusyrmdirgenericsredux-toolkitdeepcopynativeinternalcmdRxflagtrimStartmkdirsreadablereduceBigUint64Array-0tapesetpackagestyped arrayguidratelimiturlframerPushweakmapxtermidunicodemonorepogetcallbackdataviewl10ntapmixinsyamldragutilsconsttacitURLbrowserslistSetasyncFloat32Arrayes-shimsreduximportObject.keysasciigetintrinsicbundlerless mixinsformatformsArray.prototype.findLastIndexjsdiffdomjapanesexdgreact-testing-libraryexpressioncryptomiddlewareinstallprefixqueuelistenersmakeObject.getPrototypeOfBigInt64Arraymimeidleencryption3dcss lessexespawncorepipetoSortedstreamscss nestingruntimegetoptopenerreadablestreamrgbECMAScript 2017pathchromiumfast-copyTypeBoxiswalkingPromiseES2015ES3es-shim APIcreateReflect.getPrototypeOfenvspecdependenciesgdprObject.definePropertyassertbootstrap cssdeleterateless cssprotobufconcurrencyArrayBuffergetterworkspace:*accessorwatcherdayjsconfigurablegesturessortECMAScript 2019utilitiespluginrecursivecopybundlingstableecmascriptimmutabletypescriptprettyestreevaluestypesafeio-tsless compilerdeep-copystyled-componentscolumnsnamegetPrototypeOflimitthreechineselinuxcolumnpostcssconfigtesterlesscsspostcss-pluginmomentdefineconcatMapSymbol.toStringTagfiltersyntaxopenmimetypesthrottlesuperagentfseventswaitYAMLpolyfillweaksetqueryreducerinspectstyleguidedeeptypedarraysArrayBuffer.prototype.slicepatchconsolemobileponyfillspeedArray.prototype.filter[[Prototype]]esrangeerrorjson-schema-validatorcolorsbabel-corechaiinterruptsprivatepopmotiongraphqlwaapigetOwnPropertyDescriptorwhatwgcollection.es6protocol-bufferses2018yuptextECMAScript 2022jsdomStreamsRFC-6455sanitizegradients css3includesrfc4122__proto__endernegativesetImmediategradients csswritekeysfsobjectfindArray.prototype.flatMappreserve-symlinksassertionserializationstatelesstouchES2022fastclonelogfetchtermbannertc39mkdirajvjson-schema-validationObject.entriesletentriesmatchAlljavascriptbyteLengthutilUint8ClampedArraygroupByiterateString.prototype.trimpoint-freeES7inputbyteOffsetdependency managerIteratorcall-boundclassesflataccessibilityforEachexit-codelinewrapjoiviewinternal slot@@toStringTagvariables in csscommand-lineUint32Arrayfpshrinkwrapwatchingperformancetostringtagcomparetypeswidthreal-timeshamartstringifierarktypeboundindicatorWebSocket$.extendmergeargvcommanderes8matchES2017invarianttelephoneauthargumentslessescapewordwrappromisesbootstrap lesshigher-orderpromisetranspileerror-handlingfilees2017TypedArraytypeofastnamesefficientcss variableprivate dataexpresswordbreakomitless.jsreaduser-streamscssEShasOwnString.prototype.matchAllsettervariablespreprocessormapcolourstylingieloggerFunction.prototype.nameterminalavaequalansisuperstructnested csswalkirqhookformfastcopywebconcattslib6to5rm -frsymlinksInt8ArrayappsearchframeworkapiES2020eventDispatcherassignrobustcurlsharedarraybufferbddtimeextravalidateflattenlooktoStringTagtspushtoolszerofile systemresolvemodulesharmonycharacterloggingmulti-package
