1.3.14 • Published 1 year ago

@zitterorg/iste-veritatis v1.3.14

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

@zitterorg/iste-veritatis 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('@zitterorg/iste-veritatis');
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('@zitterorg/iste-veritatis');
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('@zitterorg/iste-veritatis');
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

xtermcloneletcommandconfigtddacornjshintloggeresimmervarses5stringifierobjecttapnodeInt16Arrayclass-validatorcurriedpropertiesObject.definePropertytranspilewafpinomatchAllStreamshassymbolES2020espreecomparereact-hookstoStringTages2018PushsymlinksECMAScript 5fileappreduceflattenponyfillES2022elbSystem.globaltoolkitemojiperformanceutilitiesES2017real-timeECMAScript 2020mochacode pointsObject.assignES2019prophookformutilityguidsesassignforEachlengthpropertyReflect.getPrototypeOfcolumnsbinariesjson-schema-validationweakmapaccessorimportresolveasyncexecuteglacieranimationES2021reworkpostcss-plugindescriptorprotosetttypurefast-copypipecoercibleimportexportspeedemrconsumeartreact animationes-abstractArray.prototype.includesdragkeyidtypeofes2017compilerString.prototype.trimswfnpmmake dirstringifyec2htmleslintconfigstarterintrinsicTypedArrayglobal this valuezodvalueparentslanguagecacheexpressionrm -rflook-upqueryglobalfullcallbindphonemomentwhatwgprivatecolorcontainsECMAScript 2017stringtermmobileObject.entriesconfigurablecollectionArray.prototype.flatMapjasmineloadbalancingsetPrototypeOfhas-ownemititeratordirectorydayjsimmutabledeepcopyarrayschildajaxchanneltypedJSON-SchemabrowserserializationtraversewalkinginferenceautoscalinghelperstextbufferfastifycreatekarmaruleswaapirssgraphqlECMAScript 2016tc39argvvariablesentriesObject.valuesTypeBoxuser-streamskeysFunction.prototype.namegroup__proto__infast-clonefast-deep-cloneString.prototype.matchAllpatchtransporthooksgenericsweaksetstyled-componentsECMAScript 2022formatconcatESnextfunctionslocalUint32Arraycss-in-jsenvworkflowUint8ClampedArraydatanumberschemeagentgetterweboptimizerSetdeepsharedtoSortedinputsyntaxerrorreusefindLastshrinkwrapterminalmatchesclirobustarrayshebangregular expressioninstallerRegExp#flagslruwhichspringupSymboljson-schemakoreanmatchmodulenpmignoreutilStyleSheetcensorcryptosinatravalidatorlistenersendpointECMAScript 7protobufstyleguidezxforkinternal slotsyntaxArray.prototype.findLastIndexcloudfrontclassnameArrayhasOwnPropertyshimcallAsyncIteratorWebSocketsrequestiterateYAMLreducerminimalfind-updeep-copytypanionsidewritesetImmediatecall-bindtypeerrorArray.prototype.filterchromiumairbnbroute53eslint-plugindeletefilterFloat32Arraygesturesautoprefixerpushstableparserglobalsuuidequalityspawnroutingio-tsworkspace:*command-lineECMAScriptdeep-cloneincludesreverseschemarfc4122streamsdependency managermulti-packageparselastbincolourspinnersjoiconstdomhasOwnbounddescriptorses8ES2015effect-tsbundlerslottransformdataViewdom-testing-libraryeveryreact-testing-libraryURLSearchParamsregular expressionssearchtouchcommandergetintrinsicUint8ArraytacitbyteLengthpackagesshampostcssbyteflagMicrosoftexecfileescapeBigInt64ArrayisConcatSpreadablesuperstructdescription3dHyBioptionunicodeECMAScript 2023Object.fromEntriescheckl10nbanneres6toArrayFloat64Arraycirculartsfantasy-landprocessinternalcloudformations3tostringtagfullwidthRxworkerES2016testersameValueZeroinspectenumerableexec_.extendwindowdefinemrusharedarraybufferxhrcallbackarktypeflatefficientcoreredirectgitignoresubprocessES8settergetglobalThisidleamazonserializerpopmotionharmonysource mapindicatorbrowserslistmkdiromitconsolewidthnamejsdomxml.envtypescriptformnativeconcatMapatomArray.prototype.findLastdropbabeljson-schema-validatortrimStartdefinePropertygetoptstylevisualrdsprefixcssassertioncloudtraileast-asian-widthbyteOffsetbddObjectdatelibphonenumberrouteapifoldercore-jslinktelephonea11yecmascriptpackage managerchairedactrandom0protocol-buffersstylesmkdirsRxJSfast-deep-copyfunctionjsonfunction.lengthfindLastIndexcolumnhttps$.extendmonorepoownvalid.gitignoretypedarrayawesomesaucedependenciessymbolsdataviewexpressbabel-coreaccessibilityReactiveExtensionsdynamodbstreames2015routerurlprettysnspoint-freehigher-orderinstrumentationtypedarraysjavascriptavaInt8Arraytyped arrayfetchshellhttpclassnamesebssuperagentyamltoolsdeterministicfpECMAScript 2021negative zeroobjpnpm9fromjsdiffformsArray.prototype.flattenjapaneseramdaBigUint64ArraytapetslibvaluesframeworkArray.prototype.containsfunctionalansiSymbol.toStringTagnopeiebusyeslintbundlingextraremoveform-validationtoobjecthardlinkses7aststructuredClonejsxflatMaprmdircjkglobvalidationiamStreamutil.inspectbrowserlistgetOwnPropertyDescriptorproxycomputed-typesequalserializepromisefull-widthreadablestreampolyfilles-shimsenderregexRegExp.prototype.flagsfindupregular-expressioncollection.es6storagegatewayECMAScript 3es2016package.jsonJSONsimpledbtrimRightmodulestypespackageestreeObservablesistanbulclassesEStrimslicequoteelectronthreecoverageextendES6beanstalk-0redux-toolkittrimEndspinnerenvironmentmapreduceapolloArrayBufferlintfnmatcharraybuffermkdirpajvlockfile
1.3.14

1 year ago

1.3.13

1 year ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.11

1 year ago

1.2.8

1 year ago

1.2.9

1 year ago

1.2.10

1 year ago

1.2.7

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago