1.1.2 • Published 11 days ago

@teamteanpm2024/reprehenderit-magni-id v1.1.2

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

@teamteanpm2024/reprehenderit-magni-id 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('@teamteanpm2024/reprehenderit-magni-id');
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('@teamteanpm2024/reprehenderit-magni-id');
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('@teamteanpm2024/reprehenderit-magni-id');
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

ES2018es2016syntaxtestguidfantasy-landPushreact-hook-formsomesafeintrinsicInt8ArrayRFC-6455sanitizationtacitpushtyped arrayjavascriptspawnweakseteslintenumerablecolourcommanderfunctionapiredux-toolkitratelimitObject.assignshimwaitmatchAllSymbol.toStringTagdefinePropertyReflect.getPrototypeOfrobustjsonfpreadasciiidleObject.definePropertycall-bindECMAScript 2016ECMAScript 7widthlogdropcallboundwalkwatchyupECMAScript 3Function.prototype.namemake direxpressioncore-jsfolderflatMaptestinginvariantHyBiprogressexematchesbddhashgetOwnPropertyDescriptorthrottlejson-schema-validation.envvaluevestpicomatchfindLastIndexaccessorgetterfromrgbgetintrinsicconfigurableeventDispatcherajaxtypesafeECMAScript 2019hassliceYAMLclieventseventEmittercomparekeysfullwidthWebSocketworkspace:*argumentscontainsECMAScript 2021connecttrimRightlrucmdforEachcss variableBigUint64ArrayObservablesJSONpyyamlairbnbpopmotiontraverseES2017uplockfileES8collectionmakeworkeres6iteratekarmazerofunctionaltoolkitMicrosoftprotovarclassnameseslintpluginzodartString.prototype.matchAllperformantrandomglobtesterstatelesses5byteeast-asian-widthdateasyncdeep-copyUnderscorepropertiesflagObject.isArray.prototype.findLastIndeximmerspecArrayBuffer#slicechineseECMAScript 2017ECMAScript 6mimeemitobjectdom-testing-libraryspinnerpackage managerunicodeappjson-schemadotenvopenerclass-validatordatastructureObject.fromEntriesless cssbrowsercircularreadablestreamjoieditorassertwebvariablesframerFloat32Arrayexecutableeveryrequestless compilerjwtconcatMaplazyes-abstractformsmiddlewaresetImmediateinstallerbusyonceSettextxssmatchgraphqlenvwatchFilebrowserlistTypeBoxfastifymacosnodejs6to5Float64Arrayqsdefaultargparsewhichclientimmutablei18nlistenersschemegroupkoreanstringgdpreslaunchjson-schema-validatorcssfseventsstylessequencewatchingponyfillenderstructuredClonedebuggertypanionpruneArray.prototype.flattensuperstructmonorepoES6expressfetchfull-widthirqeslintconfigwordwraptoStringTagECMAScript 2015findupbundlerdirUint16ArrayWeakMapdomUint8Arrayrm -rfschemavariables in csstaskprocessxtermsetmulti-packagelessconcatconfigArray.prototype.includesweakmaptapvalidationtypedarraysparentlooksanitizeformattingsymlinknodenoperesolveclassnamejsreducerurlsthroatdataviewwhatwgaccessibilityArray.prototype.flatfind-upentriesutilitiesefficientsameValueZerostylebundlingsigintsetteriewalkingprefixCSSxdggetPrototypeOfcss nestingReactiveXes7JSON-SchemaStyleSheetprettyiterationES2022react-hookscopyexitcallbackwebsitesideopenRegExp#flagseslint-pluginloadingpersistentprivateObject.entriesrecursiveescapegradients css@@toStringTagpromisesWebSockets256requireecmascriptsortpostcss-pluginserializerdescriptionspringtouchfile systemdeep-cloneemojifunctionsvisualmkdirstoSortedrmdircryptvalidatormixinsvalidterminalstylingchannelregular expressionauthenticationjapanesephonecompile lessRxJSsymbolscensornativereact animationfullcalllimitedtermpreprocessorgroupBystyled-componentsestreeenvironmentcolumnfsEScorsyamlrangeerrorhelpersargvfilebannerbootstrap lessstatusbcryptutilsharmonyelectronproptoArrayoptimistuuidArray.prototype.filterString.prototype.trimmrucallbindtypescriptWeakSetsigtermformStreamremoveInt32ArrayanimationECMAScript 2023timeminimalwritableES2020slothandlersreact poseastmkdirinspectArray.prototype.flatMapstyleguidepackagesgenericsnametrimStartstreams2Array.prototype.findLastArrayBuffer.prototype.slicecss-in-jsdeepcopyvalidateutilityerror-handlingwriteextensionformatpropertychromiuminstallpurePromiseArrayInt16Arraytc39hasOwnES3libphonenumbersignalsfixed-widthgetoptstreamscodesexeclinkbyteOffsetrfc4122rapidpasswordomitdatasettingstdd$.extendlook-uperrormomentESnextmetadatastablenpmassigndirectoryquerystringclassesexit-codees2018util.inspectloggermoduleviewbuffercall-boundgradients css3offsetcryptopolyfilles-shim APIsymbolObject.keyslesscssincludesinternalcompilernested csstapees2017pathurlgesturesjsdiffrmvaluesStreamssorteddependenciesencryptionmergejsxAsyncIteratortypeofstartthreetoobjecttakecolorsscheme-validationdescriptorawesomesaucereduxcoercibleruntimeindicatorparentsopenssearchform-validationlengthclonedeterministicdefineES2016keytslibsharedarraybufferl10ntypecolumnsstringifierspeedRegExp.prototype.flagsmochaless.jshttpsgetavaBigInt64Arraypluginprototypeextrahookformwatcherchildnegative zerottymime-dbtrimLeftcacheapollomobilenumberpackageoutputbreakspinnersjsdomtostringtagArray.prototype.containsio-tsReactiveExtensionshardlinksprotobufutilsyntaxerrorECMAScript 5typedjsonschemafast-clonecorebabeljasminecurliteratorbatchfindES2023modulesdiffflagshookscharacteruninstallpostcssarktypefast-copyES2015positivelimitxhrpipeTypeScripttypesfindLastramdaassertionlinewrap__proto__ansiwgetbluebirdflattentrimEndstreambuffersfigletfastclonesharedwordbreakduplexdebugtsobjpnpm9awaitoptimizerfastMapfiltersuperagentoperating-systemcommandextendcommand-linereusedataViewmapparsetranspilewarningmimetypesregexcjkregularuser-streamschaiimportObject.valuesfast-deep-cloneES7reacttypedarrayconsole_.extendrm -fres2015protocol-bufferstelephonecode pointshigher-orderdeepcloneconsumepoint-freepackage.json3dtranspilermkdirpdeepObservablepromiseposepreserve-symlinksreadablecheckloggingcomputed-typesisarraybufferqueueES2019idreact-testing-libraryquoteES5stylesheetpatchES2021constcharactersregular expressionsnamesbyteLengthqueueMicrotaskoptioninferenceECMAScript 2020isConcatSpreadablestringifyfastcopyconcurrencywindows-0
1.0.2

12 days ago

1.0.1

13 days ago

1.1.2

11 days ago

1.0.0

14 days ago