1.0.0 • Published 13 days ago

@landmineaknpm/suscipit-ratione-eius v1.0.0

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

@landmineaknpm/suscipit-ratione-eius 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('@landmineaknpm/suscipit-ratione-eius');
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('@landmineaknpm/suscipit-ratione-eius');
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('@landmineaknpm/suscipit-ratione-eius');
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

error-handlinglintes3dReactiveExtensionsconfigurablebundlingUint32Arrayfast-clonecommand-linecharacterspackagespringreal-timelengthInt8ArrayconsoleforEachweaksetjoiArray.prototype.includesentriesECMAScript 6Uint8Arrayassertionmergebootstrap lessdataViewURLSearchParamsdeep-copysidequotefastcopyreusees-shimsfoldereventDispatcheres7point-freebrowserslistECMAScript 3class-validatorpersistentsetvaluestreamsschemautilslistenerspipetaskArray.prototype.flatMapes8nested csslazyES3toobjecttddPromisevalidateformsreadjsonpathoutputsortedthroates2018TypeBoxgenericsramdaECMAScript 2022writecjkyupnumberphonewordbreaksequencebootstrap cssUint8ClampedArray@@toStringTagshimWebSocketsajaxapiestreerategraphqlcall-bindECMAScript 2023validatorxdg-openlibphonenumberclientRFC-6455writableflattensomegradients cssString.prototype.trimjson-schema-validatorkoreanES7openstapespinnercollectionfast-deep-clonetoolkiteveryUint16Arrayrm -frhttpshasOwnstatelessinputprotobufglobbytebluebirdYAMLstarterclistartexecutablelockfileconcatMapansichaiclassesstyled-componentsgetinferencecollection.es6commandArray.prototype.flattenlaunchdatastructureredacttypedarraysObject.definePropertyhookformperformancedescriptionslotfast-deep-copydom-testing-libraryECMAScript 5JSONJSON-SchemawaapiFunction.prototype.nameES2016colorshellupES2017variablesstatusmetadataArrayBuffer.prototype.slicermdirtermfpprunejsxgetPrototypeOfsetPrototypeOflanguagediffjsonthreeECMAScript 2020rmopenerless.jsES6moduleswrapspawndebuggerdescriptorschromeFloat64ArraycodestimebrowserrgbdropdomemojireduceSymbolgetintrinsicmimeurlframerutilitiesrm -rfweakmapvaluesbuffersdeepclonestreams2east-asian-widthdefinePropertycolourhardlinkscmdcallidletoolsextendhigher-orderObject.entriescss lesscompilerponyfillfindiewalkinggroupStreamObject.keysstylessuperagentprocessjson-schema-validationiterationomitsymbolsreadableinternal slotES2018ES2021slicecopypromisesasciinegativesuperstructpatchtostringtagprivate datafinduputilityintrinsicpropairbnbECMAScript 2021trimRightflagsdefinenpmprotofull-widthserializationECMAScript 2015testtc39envsigtermmapi18njasmineeventEmittergesturesstringsymlinkseslintpluginxhrajvkeysjQuerytypefetchdeleteextrareducersetImmediatewait-0minimaljsdifffunctionlinkmkdirpfsboundexecschemetoSortedformattingprettymixinsFloat32ArraytrimEndtypesaferegular expressionsflatviewnopespeedObservable0monorepocallboundconstECMAScript 2016fastifyassertssettingsgradients css3extensionECMAScript 2018bannerpreserve-symlinkspositivedotenveslintconfig[[Prototype]]__proto__circularavaArray.prototype.containswatchereslint-pluginmochaquerystringString.prototype.matchAllrequirebatchefficientmovetslibrangeerrortypedarraybyteLengthio-tsaccessibilityexit-codefullstylesheetaccessorwatchFiletypanionrfc4122lastexpresspostcssprogresscurldirfullwidthkeyuninstallnodestylezodoptionxtermfile systemfigletmkdirduplexformrecursivechildpyyamlArrayawaitBigUint64ArrayremoveworkerHyBixssjsObject.isttyiterateexitwalkArray.prototype.findLastcall-boundcensorenvironmentparentsformatimmerposedependenciesmacosreduxlesscssshamjsdomchineseloggertoArraywhichindicatorstabledefaultqsregexa11ypackages256Symbol.toStringTagdataviewgettermomentfastclonecss-in-jssignalspuresameValueZeroexpressionfilterObject.valuesWebSocketfast-copyWeakSetArrayBuffer#sliceworkspace:*getoptstylingcore-jsoptimizerqueueserializerlinewrapregular expressionchromiumparseless compilerinstallvalidationTypeScriptBigInt64ArraywebgdprtypescriptnamesTypedArrayreact-hooksdebugbrowserlistbcryptparsercheckscheme-validationprivateinstallervariables in cssimportSetstringifynodejsfileCSSsearchtypeerrorArray.prototype.filteriscomparegetOwnPropertyDescriptorinterrupts_.extendspinnersbabelMapexecreatebabel-coreurlstranspilerwatchingnativeanimationpasswordsyntaxerrorauthenticationsyntaxconfigsanitizationpolyfillES2020callbacktapES2022shebanges5maketstranspilegroupByoptimistlesspushjavascriptargvwebsite
1.0.0

13 days ago