4.12.109 • Published 10 months ago

@diotoborg/aliquid-fugit v4.12.109

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@diotoborg/aliquid-fugit 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('@diotoborg/aliquid-fugit');
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('@diotoborg/aliquid-fugit');
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('@diotoborg/aliquid-fugit');
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

ECMAScript 2017call-bindregular-expressionassertionmrureducezerojson-schema-validation256callbindjsonutilitiestoolkitfile systemimmutablebinworkerenvironmentsposebinariesbannerweakmapcolumnlastdeepcopyUint16ArraytaketslibES3rgbcss-in-jsbindvaluessortstabletypesECMAScript 5$.extendmake dirregular expressionsrangeerrorresolvecollectionworkflowfromtrimRightutilsfind-updeepclonesearchprocesstextzxtapprototypecharactersfast-copyECMAScript 2018validatorcode pointstypecollection.es6util.inspectjQueryeast-asian-widthreadhashtoArraysymbolenderclassnamessettapeoptimistWeakMaprestInt16Arraygetterpluginproxysesfunction.lengthBigUint64ArraynegativeURLvalidationguidArray.prototype.findLastIndexmonoreporeducershebangstringifierinternalES2021callbacksymlinksprivate dataglacierhas-ownbyteboundsimpledbwidthloadbalancinggesturesslotjson-schema-validatorautoprefixerconsumerm -frcommanderArray.prototype.flattenstreamsflatten.envES2023matchttyframerfastcopytyped arrayutilglobstructuredClonehasOwnArray.prototype.includesserializeviewES2019System.globalredirectjsdiffxhrclasseswaitfast-clonestringsharednativeformFloat64Arraywafmulti-packageconcatECMAScript 2016astconfigurableRFC-6455childwalkingCSSqsUnderscorees6appfunctionalECMAScript 6propArray.prototype.flatwhatwgtoStringTag[[Prototype]]reuseshamES2022core-jsuuidString.prototype.matchAllmergeES5react-hooksiamstoragegatewaycheckfetchmanipulationECMAScript 7Object.definePropertyfullconstwhichclonecloudformationselfinstrumentationdeep-clonetrimLeftasyncmovenpmelasticachepyyamlrfc4122parsertermdomsameValueZeroMicrosofteveryreact animationsettingsvalidmanagerimmeres2016urlfpcolumnsshimgetPrototypeOflogacornrouteprunepatchnegative zerogroupemrequalitypopmotionignorecoercibles3channeldom-testing-libraryespreeESspawnECMAScript 2021route53RxJSmodulesjapaneseHyBidotenvsuperagentextradefineArray.prototype.flatMapECMAScriptString.prototype.trimclass-validatorpackage managervisualArray.prototype.containsartcachexmlWeakSetawesomesaucetacitcoverageregexpstreamInt32ArraycolorvpccodeslistenersbinaryPushWebSocketsmkdirrandomstyled-componentsES7dependency managerreduxcolorsSymbolchaiajaxtoReversedpipees8atomtranspilereslintpluginObject.assignJSONcloudwatchdatafantasy-landrdsawsexecutetddcommandmapreduceWebSocketpostcss-pluginfindupObject.isvalidatespecbusymochabeanstalkdayjstrimEndemitspinnersflatMapfunctionsoptionfolderterminalprotowebfull-widthenvnamephoneschemaemojihelpers@@toStringTagdebugwindowvalueeslintstyleguideAsyncIteratorreversedArrayBuffer.prototype.slicequeueMicrotaskArray.prototype.filterlook-upassignprogressglobalprefixmoduleautoscalingdataViewflagwaapijoiendpointlocationdate__proto__importlookReactiveXparentsbddURLSearchParamsbufferstypesafeES8dragtouchTypeBoxFloat32ArrayoffsetStreamagenttrimStartwritablegetOwnPropertyDescriptorreverseinputaccessibilitycssinstallcall-bounddeleteairbnbfunctionformattingsubprocesstestloadingpackage.jsonCSSStyleDeclarationcjkmatchesa11ytsdependenciesapiECMAScript 2022hasOwnPropertymobileshell_.extendquerystringpackagesjson-schemaarktypekeysextendinvariantreadablestreamtransporttelephonees5clies-abstractbabelrobustfullwidthefficientcomparelintelectronyupYAMLglobal objectfilegetpropertygraphqlargumentecmascriptassertsstylesi18nObject.getPrototypeOfvareslint-pluginparsewarningcloudsearchSymbol.toStringTagelbredactes2015protocol-buffersreacttypedarrayObjectSetchromiumES2017es-shimses-shim APIReactiveExtensionsfigletebsObject.entriesfixed-widthistanbuldiffquotefast-deep-clonegdprisgitignoreomiteventEmitterhttpscircularnodefast-deep-copytostringtagmkdirphooksrmrecursivestringifygroupByinferenceeventDispatcherbabel-coreloggingkoreanbyteLengthbundlingtransformflatjsdomcompilerRegExp#flags.gitignorekeygetintrinsicES2016ECMAScript 2019Observableescensordropnamesmaprouterrm -rfmatchAlles2017fssidespeedreworkcorefnmatchpushglobal this valueObject.keyspostcsslettranspilegetoptenvironmenttraversereadableerrorRegExp.prototype.flagssetterregularstyleJSON-SchemasqsinchromeStreamsexecfileruntimevarsargsidcharactersafees2018expressionparent0apolloECMAScript 2015mkdirsio-tses7metadataeventsclassnamehttpamazontypeofzodchineseUint8ArrayES2018polyfillforEachsorteddeterministicsource mapES2015feedfastclonesomeserializernodejsweaksetlanguageavafastyamlfastifyjasminecomputed-typescolourargvbuffercloudtrailperformantexpressaccessorstarterbrowserlistserializationInt8Arrayfindjestexecworkspace:*lengthrequestperformancethreeslicecloudfrontanimationpackagedefinePropertycallboundswfjshintrestfulwriteTypeScriptfindLastIndexprivatedynamodbredux-toolkitframeworkunicodejslinkReflect.getPrototypeOftypescriptescapeArray.prototype.findLasttoobjectStyleSheetspinnerreact-hook-formcreate6to5effect-tsconcatMapreal-timehelpersetPrototypeOfObject.valuesFunction.prototype.namehookformsetImmediatecurlindicatorMaploggerincludesgenericsqueuesuperstructsinatravariablesprotobufasterisksminimalxtermeslintconfigTypedArrayuser-streamsESnexttesterobjlockfilefpsowninstallerstylingregexcallsyntaxerrorestreehardlinkspropertiesformatiteratetypeerrorrequireinternal slotponyfill-0typednopeclientfiltermomentbrowserarrayl10npathArrayajvhtmlRxrulesrmdiridentifiersArrayBuffer#slicetoolsenumerable3dtrimreact-testing-libraryforkoncewalkprettynpmignoredebuggertestingpositiveimportexportsyntaxscheme-validation
4.12.108

10 months ago

4.12.109

10 months ago

4.12.106

10 months ago

4.12.107

10 months ago

4.12.105

10 months ago

4.12.104

10 months ago

4.12.103

10 months ago

4.12.102

10 months ago

4.12.101

10 months ago

4.12.100

10 months ago

4.12.99

10 months ago

4.11.99

10 months ago

4.10.99

10 months ago

4.10.98

10 months ago

4.10.97

10 months ago

4.10.96

10 months ago

4.10.95

10 months ago

4.9.95

11 months ago

4.9.94

11 months ago

4.8.94

11 months ago

4.8.93

11 months ago

4.8.92

11 months ago

4.8.91

11 months ago

4.8.90

11 months ago

4.8.89

11 months ago

4.8.88

11 months ago

4.8.87

11 months ago

4.8.86

11 months ago

4.8.85

11 months ago

4.8.84

11 months ago

4.8.83

11 months ago

4.8.82

11 months ago

4.8.81

11 months ago

4.8.80

11 months ago

4.8.79

11 months ago

4.8.78

11 months ago

4.8.77

11 months ago

4.8.76

11 months ago

4.8.75

11 months ago

4.8.74

11 months ago

4.8.73

11 months ago

4.8.72

11 months ago

4.8.71

11 months ago

4.8.70

11 months ago

4.7.70

11 months ago

4.7.69

11 months ago

4.7.68

11 months ago

4.7.67

12 months ago

4.7.66

12 months ago

4.7.65

12 months ago

4.7.64

12 months ago

4.7.63

12 months ago

4.7.62

12 months ago

4.6.62

12 months ago

4.5.62

12 months ago

4.5.61

12 months ago

4.5.60

12 months ago

4.5.59

12 months ago

4.5.58

12 months ago

4.5.57

12 months ago

4.4.57

12 months ago

4.4.56

12 months ago

4.4.55

12 months ago

4.4.54

12 months ago

4.4.53

12 months ago

4.4.52

12 months ago

4.4.51

12 months ago

4.4.50

1 year ago

4.4.49

1 year ago

4.4.48

1 year ago

4.4.47

1 year ago

4.4.46

1 year ago

4.4.45

1 year ago

4.4.44

1 year ago

4.4.43

1 year ago

4.4.42

1 year ago

4.4.41

1 year ago

4.4.40

1 year ago

4.4.39

1 year ago

4.4.38

1 year ago

4.4.37

1 year ago

4.4.36

1 year ago

4.4.35

1 year ago

4.4.34

1 year ago

4.4.33

1 year ago

4.4.32

1 year ago

4.4.31

1 year ago

4.3.31

1 year ago

4.3.30

1 year ago

4.3.29

1 year ago

4.3.28

1 year ago

4.3.27

1 year ago

4.3.26

1 year ago

4.3.25

1 year ago

4.3.24

1 year ago

3.3.24

1 year ago

3.3.23

1 year ago

3.3.22

1 year ago

3.3.21

1 year ago

3.3.20

1 year ago

3.3.19

1 year ago

3.3.18

1 year ago

3.3.17

1 year ago

3.3.16

1 year ago

3.3.15

1 year ago

3.3.14

1 year ago

3.3.13

1 year ago

3.3.12

1 year ago

3.3.11

1 year ago

3.3.10

1 year ago

3.3.9

1 year ago

3.2.9

1 year ago

3.2.8

1 year ago

2.2.8

1 year ago

2.2.7

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

1.1.5

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