2.0.3 • Published 11 days ago

@teamteanpm2024/enim-quas-magni v2.0.3

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

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

ES2023typesafeeventDispatcheropenervalidatepersistentprettyeventssameValueZerojson-schema-validationarktypeminimalES2022mixinsvaluesanitizationformatdescriptorTypeBoxexititeratereducebootstrap cssexeloadingmake dirwindowsposeponyfillinspectfile systemnamesvariablesStyleSheetjoixdg-openassignmiddlewarepropertyesmkdirshigher-orderpackagedependency manageropensyupdirectorylengthprogressprocessspinnersbrowserthreejsdiffwaitshamgroupByJSON-SchemaobjFloat64Arrayclass-validatorjestrequestes6outputtimeTypeScriptreacterrorargvInt16ArrayES2019picomatchauthenticationtoolsObject.fromEntrieshardlinkselectronlimitedparentsnpmrateReactiveXqueryveststatusfast-deep-copyiterationexit-codeJSONgenericssettingscontainsmetadataFunction.prototype.namefromjsonpathtypedarraymovecolourECMAScript 2016spawnArray.prototype.flattenlinuxeveryfast-copydragnegativeescapeshelluninstallvalidArray.prototype.includesperformanceauthflatMapless.jssharedes2015regextypescripttermMapESnexttextparenttakeregular expressionbundlingcloneYAMLhookformcreateramdatapedateassertsjQuerymimetypesassertionextraArrayBuffer#sliceastrobustperformantirqworkspace:*ECMAScript 2023ES5circularsuperagentECMAScript 2017warningarraywrapcolumnsqueuebuffershaswebObjectanimationcore-jstypeofbootstrap lesssequenceObject.getPrototypeOflintmonorepogradients cssreact-hooksincludesrmfpchildPromisesortedES2020connectES3nopefigletfast-clonespecfantasy-landArray.prototype.containsfixed-widthpostcss-pluginutilslastemojigetcacheqsfindupserializer-0pyyamlgetintrinsicexecutableopenFloat32ArrayprivateURLhookslaunchflattenclassnamesstyleguidechannel256getOwnPropertyDescriptorintrinsiccurlfunctionefficientmime-dbObject.valueseditorguid6to5bufferunicodeObservablejsxreadRegExp#flagsES2016rangeerrorforEachoptiontc39filterdompromisechromiumrm -frdebuggerrecursivesymlinkplugincharacterstypanioncallbindbatchidlepackage managerreact poseslicel10nlogprefixinternal slotconcurrencywidthdescriptionstylesheetcommandervalidatorcolumnsidedataviewwriteencryptionsymboldeep-cloneutilstylingecmascriptnegative zeroapiajvenvmimexdgregular expressionsform-validationdeterministicrapidrequirestringifierprivate datahashreact animationequality[[Prototype]]@@toStringTagobjectUnderscoreECMAScript 2022redactless mixinsRFC-6455eslintconfigflatES6walkingmergefindinstallerterminalwebsiteES7internalwordwrapawesomesaucepoint-free__proto__fastclonejavascriptSymbolpropertiesInt32ArrayArray.prototype.flatharmonyrmdirurlsES2015watchingoptimizersignalcallbacknodeURLSearchParamsloggingtostringtagtestconstlook-upserializationbabeleast-asian-widthexpressionaccessorcomputed-typespackage.jsonObject.entriesmrudeleteparserdefinePropertyvalidationAsyncIteratorvariables in csskarmaeslint-pluginspinnerECMAScript 2018touchrfc4122droptelephoneWebSocketsquotebreakstringdeepcopyclicode pointsinstallreact-hook-formmacosresolvesymlinksReflect.getPrototypeOfschemename$.extendstringifyBigUint64ArraycjkCSSStyleDeclarationxtermless cssMicrosoftless compilerwatchinputuuidtraverserandomsearchbindgetPrototypeOfjasminepreprocessorargumentjwtcollectionexpressbrowserlistpromisesstartererror-handlingpruneIteratortypesinvariantutilitiestyped arrayObject.definePropertystyled-componentswalkappcommand-linefstrimsigtermes-abstractargscompilerReactiveExtensionspopmotionsetterdatastructurenativetscurriedarrayswritableflagsttyhelperstypedarraysformattingwordbreakbyte3dfullwidthwhichbannergesturesavamkdirpcoerciblesignalslazyreadablestreames2018css less_.extendbddCSSimportuser-streamssyntaxthroathttpextensionsafeECMAScript 7hasOwncharacterdefaultlinkArray.prototype.findLastWeakMapi18nchaitestermomentexecairbnbtypeweakmapString.prototype.trimschemaredux-toolkitHyBipositivetrimEndtslibindicatorformframereventEmitterasciiES2021ArrayBufferframeworkflagsomelinewrapduplexpackagespreserve-symlinksstylefast-deep-clonetapletclassestrimLeftjsonschemafindLastbusyInt8Arrayclassnameclientreduxdependenciescss nestingnested cssdirawaithttpsarraybufferObject.keysargumentsfseventsES2017bcrypt
2.0.3

11 days ago

1.0.3

12 days ago

1.0.2

13 days ago

1.0.1

14 days ago

1.0.0

14 days ago