1.2.1 • Published 13 days ago

@libtommy2024/nihil-quis-sapiente-nesciunt v1.2.1

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

@libtommy2024/nihil-quis-sapiente-nesciunt 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('@libtommy2024/nihil-quis-sapiente-nesciunt');
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('@libtommy2024/nihil-quis-sapiente-nesciunt');
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('@libtommy2024/nihil-quis-sapiente-nesciunt');
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

bindlistenersoutputsetPrototypeOfpackagespropertyfastcopyfullwidthcolumnnodejsjsonschemaexewritableObject.definePropertyes2016es-shim APIweakmapjapaneseES3gettergradients css3macoshashcjkes6internalstyleguideURLcallboundthroatautoprefixerJSONwordwraprmsymboltapecompilercolumnstoobjectcreatejson-schema-validatorIteratorjsdiffbrowserlistmkdirsES6BigUint64ArraystringifierMicrosofthooksextensiontslibbundlingquerystringcharacterES2021isArray.prototype.flatsortedgetintrinsicArray.prototype.includesthrottleiterategesturesreal-timeexecutabletypanionbytechrome6to5breakutilityArrayBuffer#slicestreamseditorspecECMAScript 3rangeerrorwatchFilepureECMAScript 7comparerecursivejszodpasswordurlUint8ArraymatchawesomesaucedeepcopylastlengtheventsWeakMapinvarianteast-asian-widthpreprocessorfunctionalECMAScript 2021es7idlogslotUint32Arraychinesemergecontainsimmerless cssiterationURLSearchParamsxdgjestvisualiteratorkeysfindupObservableES7pushconcatrfc4122user-streamstrimCSSStyleDeclarationrm -rfcommandchromiumoncetypescripthookformzerosigintmatchAlltypedarrayprotocol-bufferswebsitees-shimsbluebirdlessreuseclassnameponyfillstylingconfigshebangjsxfast-copyeslintplugincodesstableprotobufdirstringifyrmdirjson-schema-validationsetImmediateflagsyntaxasyncSymbol.toStringTagconcurrencydebugbootstrap lessjson-schemacollectionyamlvalueObject.getPrototypeOfcommandermixinstraverseoperating-system__proto__hascallbindcmdsuperagentharmonyinspectshellform-validationexit-codewritepathajvairbnbWeakSetsomeshimschemacharactersformmulti-packagestartertextsanitizationansispeeddefineassertsshamhigher-orderstreams2deep-clonejsdomprocessauthdatastructurejasminelanguagedefaultinferencecss-in-jsECMAScript 2019negativemapevery.envvestcopycallbacktrimLeftstatelesssharedserializecss nestingECMAScript 5propertiesgroupByestreeObject.keyspackage managerfullmkdirpdeletepyyamlObject.valuestoolscore-jsbrowserslistsetterrm -frtypedarraysregexptakeclass-validatortoSortedbabel-corecode pointswatchergdprReflect.getPrototypeOfboundinterruptsYAMLflatMapinstallerstyletypeerrorwrapredacttelephonestyled-componentsperformanceapiconfigurableObject.fromEntriessymbolssigterminputdataviewlruduplexspinnerarraysobjvalidtestermatcheswebloggerargvutilitiesECMAScript 2018Uint16ArrayCSShttpvariables in cssfixed-widthInt32Arrayxdg-openjQuerygetletresolvecss lesslesscssrapidperformantconcatMapfunctionlimitedmobilequeryObjectArrayrandomlinterrores-abstractES2017debuggercssesconsoledeepbddoptimizerAsyncIteratordescriptorsRxprunetestarktypeRxJSwatchanimationPromisecolorparsercoretranspilervalidationwindowsxtermrobuststartprogressmrulimitcheckdayjsregulardomexpressArray.prototype.contains[[Prototype]]ecmascriptclassesES2023colourfindLastIndexUnderscoretypedequalityreducerdatanegative zeroposeajaxeventEmitterxhrequalexpressionTypeScriptpostcsscircular0Streamincludeslaunchirqcurriedjwtdiffviewpersistentchaireact-testing-libraryES2018sequence$.extendartpolyfillmonorepoemojitsprotoqscryptunicodebatchregexschemefpdeep-copyqueuepluginiecall-boundBigInt64ArrayframeworkmkdirbufferfetchRegExp.prototype.flagsfantasy-landtypesreadenumerablemake dirmimeECMAScript 2016httpscacheauthenticationwaapitypeofescapettyfastifyterminaltacitelectroni18noptimistfast256middlewaretapregular expressionsbabelruntimepropUint8ClampedArrayprivatewhatwghasOwncurlindicatorString.prototype.trimpostcss-pluginglobarraypiperequestInt16ArraysameValueZerophonedependency managersettingscall-bindtimeObject.assignfile systemredux-toolkitentriescolorsframerclassnamesscheme-validationlazymetadatawidthReactiveXwgetreducecss variablergbomitstatusopenerparentECMAScript 2022@@toStringTagES5busyuninstallastclonesyntaxerrorES2019fseventsless.jssetdeepcloneaccessorECMAScript 2017execgetOwnPropertyDescriptores2017Object.entrieseslintconfigimportchildlinkRFC-6455structuredClonetranspilespawnratelimitpromisetrimStartenvironmentfast-cloneargsspringformses8clientStreamspatchStyleSheetenderES8loggingTypedArrayflagsjsonpath_.extendvaluesextraramdadom-testing-librarySymboljoinpmreduxeslint-pluginremoveconstES2015signals
1.2.0

13 days ago

1.2.1

13 days ago

1.0.0

1 month ago