1.0.0 • Published 1 year ago

@crabas0npm/nulla-repudiandae-consequuntur v1.0.0

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

@crabas0npm/nulla-repudiandae-consequuntur Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2015 mostly-spec-compliant Reflect.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('@crabas0npm/nulla-repudiandae-consequuntur');
var assert = require('assert');

assert.throws(() => getPrototypeOf(true));
assert.throws(() => getPrototypeOf(42));
assert.throws(() => getPrototypeOf(''));
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('@crabas0npm/nulla-repudiandae-consequuntur');
var assert = require('assert');
/* when Reflect or Reflect.getPrototypeOf is not present */
if (typeof Reflect === 'object') { delete Reflect.getPrototypeOf; }
delete globalThis.Reflect;
var shimmed = getPrototypeOf.shim();
assert.equal(shimmed, getPrototypeOf.getPolyfill());

assert.throws(() => Reflect.getPrototypeOf(true));
assert.throws(() => Reflect.getPrototypeOf(42));
assert.throws(() => Reflect.getPrototypeOf(''));
assert.equal(Reflect.getPrototypeOf(/a/g), RegExp.prototype);
assert.equal(Reflect.getPrototypeOf(new Date()), Date.prototype);
assert.equal(Reflect.getPrototypeOf(function () {}), Function.prototype);
assert.equal(Reflect.getPrototypeOf([]), Array.prototype);
assert.equal(Reflect.getPrototypeOf({}), Object.prototype);
var getPrototypeOf = require('@crabas0npm/nulla-repudiandae-consequuntur');
var assert = require('assert');
/* when Reflect.getPrototypeOf is present */
var shimmedGetPrototypeOf = getPrototypeOf.shim();
assert.equal(shimmedGetPrototypeOf, Reflect.getPrototypeOf);
assert.equal(Reflect.getPrototypeOf([]), Array.prototype);

Tests

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

statusfast-deep-cloneclassnamemruECMAScript 2015i18nebsargparsedataViewfolderObject.entriestypea11yestreebannerInt8Arrayfullfind-upArray.prototype.findLastIndexshimexitutilitydeep-clonereducerES3setImmediateeast-asian-widtheditorvalidationweaksetisConcatSpreadablearraysmatchcurluninstallwalksinatrachromeconsumelazypostcssawaitexpressionWebSocketglobchildcore-jssetajvdeterministicdynamodbES2023make dirprunefindschemaqueueMicrotaskeveryttybundlerSymbolweakmappropertylesscssES2018nodedebugES6scheme-validationmobiledependency managerrapidpnpm9textyupUint8Arrayvalides2017lrusharedvalidaterequireonceduplexdayjsrfc4122dirPromisestatejsontoolscharactercloudsearchwalkingserializeeslintconfigarktypelinkiteratormulti-packagestyleinspectgradients css_.extendcallbindoptimizerworkspace:*testingaccessibilityString.prototype.matchAllxtermes-shim APIphonepathimportfigletcoerciblemixinssnsdotenvslotES2016reduxArray.prototype.flattentapsymlinkec2httpsprocessparentsarrayswfoffsetefficientgetintrinsicoperating-systemhigher-orderlanguagemkdirpWebSocketselasticacheminimalIteratorspawnvestentriesURLfindLastmacosnamesbrowsersliststructuredCloneflattenreact-hook-formargvconcurrencyreactcoloropensawesomesauceECMAScript 3keyslengthpropertiesenvironmentvariables in cssastmiddlewareUint32ArraywgettypedfunctionalES2017glacierredactvaluesreadio-tscss lessprivatemoduleformatstartpredictableFloat32Arraysequencefindupconcat@@toStringTaginterruptsES2019trimemrpushfseventstestUint16Arraydependenciestypedarrayspromises256rm -frfastcopyrobustmovecode pointsautoprefixerzeroexpresselbmimewatchFilewhichhelperschromiumObject.assignstoragegatewaynested csspolyfillpatchomitprivate datamkdirlookguides-shimsmonorepoextendfunctiondataviewdom-testing-librarygrouperror-handlingtypesafestatelessReactiveXeventDispatcherawsenvironmentspipeimmerlockfileStyleSheetrangeerrorRegExp.prototype.flagsvpcglobalsavadomflatkoreanstringkarma[[Prototype]]listenersbyteOffsetArrayBuffer#slicehttpinArrayassertenvwarningECMAScript 7ECMAScript 2016cjkstartervisualsuperstructcmdcheckquerypropl10npostcss-plugincensorBigUint64Arraysafetoobjectmetadatajapaneseterminalspinnerswaitinvariantpyyamlbcryptmime-dbStreamidfsjasmineredux-toolkitfastcloneapishrinkwrapstyleguidetakehardlinkssigtermtypeerrorFloat64ArraycircularstablesesES2021jsregexserializerwindowstypescriptcss-in-jsObject.fromEntriesirqplugindebuggerECMAScript 2020beanstalkserializationwatchingpreserve-symlinksthrottleagenthasOwnpositiveRegExp#flagsBigInt64ArrayargsrequestidentifiersString.prototype.trimpackage.jsonoptimistreuseexit-codeshamcontainsbindgetPrototypeOfpreprocessorinstallercss variablergbconcatMapauthenticationfull-widthsameValueZerocodesdirectoryES2020ECMAScript 2017Setnegative zeroUnderscoreeslintsymbolscommandsortedsigintmapreducelinuxlesspackagesgradients css3iterateforEachArray.prototype.containsdiffsearchinstallruntimermdirproxyless.jswrapurlyamlcalltyped arrayassigncommand-linestylesfindLastIndexECMAScript 2022hashdefinePropertygetencryptionbufferswafcallboundperformantfetchconnectreact-hooksurlsloggertapeownloggingcss nestingSymbol.toStringTagsyntaxerrorlimitedinternalecmascriptwebsiteopenerchineseECMAScript 5cloudfrontes8enderprogressform-validationpasswordoutputtrimRightstreamrestfultypeofReactiveExtensionsuuidpromisespinnertddES5asciipersistentspecclassesformes2018es5fast-cloneendpointCSSairbnbparseArray.prototype.filterJSONcryptansiunicodeextracachees2015loadingbytecolumnArray.prototype.flatMapbootstrap cssprefixargumentspicomatch
1.0.0

1 year ago