1.0.0 • Published 13 days ago

@ryniaubenpm/voluptas-sapiente-numquam v1.0.0

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

@ryniaubenpm/voluptas-sapiente-numquam 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('@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

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
1.0.0

13 days ago