1.2.29 • Published 1 year ago

@juigorg/magni-fuga-sit v1.2.29

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

@juigorg/magni-fuga-sit Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES5 mostly-spec-compliant Object.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('@juigorg/magni-fuga-sit');
var assert = require('assert');

assert.equal(getPrototypeOf(true), Boolean.prototype);
assert.equal(getPrototypeOf(42), Number.prototype);
assert.equal(getPrototypeOf(''), String.prototype);
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('@juigorg/magni-fuga-sit');
var assert = require('assert');
/* when Object.getPrototypeOf is not present */
delete Object.getPrototypeOf;
var shimmed = getPrototypeOf.shim();
assert.equal(shimmed, getPrototypeOf.getPolyfill());

assert.equal(Object.getPrototypeOf(true), Boolean.prototype);
assert.equal(Object.getPrototypeOf(42), Number.prototype);
assert.equal(Object.getPrototypeOf(''), String.prototype);
assert.equal(Object.getPrototypeOf(/a/g), RegExp.prototype);
assert.equal(Object.getPrototypeOf(new Date()), Date.prototype);
assert.equal(Object.getPrototypeOf(function () {}), Function.prototype);
assert.equal(Object.getPrototypeOf([]), Array.prototype);
assert.equal(Object.getPrototypeOf({}), Object.prototype);
var getPrototypeOf = require('@juigorg/magni-fuga-sit');
var assert = require('assert');
/* when Object.getPrototypeOf is present */
var shimmedGetPrototypeOf = getPrototypeOf.shim();
assert.equal(shimmedGetPrototypeOf, Object.getPrototypeOf);
assert.equal(Object.getPrototypeOf([]), Array.prototype);

Tests

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

snsonceoptiones-shimsbrowsergroupBybindfull-widthviewcensorshebangs3kinesispathbundlerStreamsdeepcopytesterwhichutilswfinternalbyteLengthasyncwhatwgfilterinputrangeerrorcomparedom-testing-libraryentriesstructuredClonetelephoneeast-asian-widthcompilerdebugencryptionduplexequaloptimizerendpointecmascriptmime-dbargsjsdomisConcatSpreadablees8less mixinsflagsreact-hook-formpackagesReactiveXdefinestatelessgraphqlfast-clonemixinsconcatMapFloat64Arrayfetchstringify_.extendenvironmentsettingscloudwatchInt8Arraygradients css3call-bindcoercibleshellurlsafewordwrapsymbolsymlinksconfiges2017Maptc39css nestingchannelmake dirmulti-packagecheckeslintpluginschemebddsetterObservableECMAScript 2021package managerwafassertsnegative zeroes2015folderreal-timecharacterrdsRxJSpatchfastcloneloggervalidatecompile lessflattenchineseobjcall-boundinstallerES2021es2018proxyInt16Arraytypeerror.envconnectnamesESnextpersistentrandomhasclonedynamodbdescriptorscolumnes-shim APIcacheaccessorsyntaxstylesheetmatchESequalitycode pointsrgbserializationapimkdirplogsidevisualoffsetES2017colourendertypeofrouteowntraverseprivatecallbackmergenameURLSearchParamscjkawsutilitystyled-componentswritablefindLastIndexoptimistfigletpruneless.jstrimRightPushECMAScript 6ECMAScript 2022extensionPromiseUnderscoredomec2Object.fromEntriesio-tswatching[[Prototype]]languagetrimEndimportchromiumpicomatchagentstyleguidees5livejapanesewritekoreangetoptcomputed-typestoolsutil.inspectweaksetpnpm9mochacolumnserrorpromisesargparsextermchromewaitesspinnermkdirsredirectes7bufferES2018variablesgetString.prototype.matchAlldependencieslazytyped arraymapreducenodeassign256reduxArray.prototype.containsdropArray.prototype.flattentypesafeprefixStyleSheethasOwntimeYAMLformattingwatcherqueuefindupstablematchAllperformancesharedcsses-abstractindicatorutilitiespackagefile systemgetterhooksdescriptorObject.ispropertyelasticacheBigUint64ArrayjsarktypecolorsObject.assigninferencefrompredictablevaluesWebSocketArray.prototype.includeslistenersfast-deep-cloneES8classnamesworkflowvaluecreatemoveespreelimitedpropertiesloadingES2020keysa11yArrayBuffer#sliceregexprmArray.prototype.filterstdlibquerystringdescriptionreact-testing-librarybannerform-validationsimpledbcharactersparentskarmaomitmimeECMAScript 2020Uint16ArraytaskAsyncIteratorTypeBoxlimitshimeventDispatcher@@toStringTagbeanstalkmonorepoRegExp#flagstoStringTagspecparsingcolorjsxECMAScript 2015spinnersdatastructuretapSetisbatchstoragegatewaystreams2copypackage.jsonlibphonenumberforEachreplaytypesdebuggercommandercodesrequiredirMicrosoftintrinsicgetOwnPropertyDescriptorES2015coretakefast-deep-copygradients cssnodejsexpressionflathigher-orderiteratorscheme-validationcollection.es6yupformathelpersimportexportautoscalingwidthcss-in-jsUint32ArrayFunction.prototype.namethroatjavascripthasOwnPropertyECMAScript 2016fastifyextraobjectnumberbuffersbusyRegExp.prototype.flagsdeleteES2022route53cloudsearchshamcurlwalkES2023includesnested csscss variablelookdayjswalkingES5speedJSONtddglacierstateless compilerSymbol.toStringTagguidtestconcatcircularCSSbluebirdObject.entriesdeep-copybyteOffsetcloudtrailURLclassesArrayi18neslintObject.getPrototypeOfprettyschemasyntaxerrorArray.prototype.flatMapstylesprototypecore-jseslintconfigargvsuperstructauthenticationtrimStartbootstrap csszodastmkdirCSSStyleDeclarationassertionnpmvariables in cssframeworkmapbrowserslistregulartoArraylinkclassnameimmerdeep-clonestyleFloat32ArraySymbolremovemiddlewarestringifierjsonpathbcryptcryptofluxeventEmitterbundlinghotfsdatahas-ownECMAScript 7es2016gdprrapidmomentsuperagentresolvetouchfpsprogresselbautoprefixershrinkwraplastformboundreducerfindcontainsterminalaccessibilityworkspace:*deepjoiiteraterm -rfslicearraysmoduleponyfillinspectroutingObject.keysopengroupvalidationoutputtoSortedqsapolloidsameValueZerodependency managerajaxbootstrap lesschaireadreadablermdirmetadatalockfileUint8Arraypasswordtapestylinglook-upsetImmediaterobustjQueryes6wordbreakRxperformantTypedArraysome-00negativeavapipeserializeajvglobdefinePropertyfullwidthtssqsECMAScript 2019WeakMapES7regular expressionsworkerestreeconsolereducemrutypeinfastthrottlepushjwtArray.prototype.findLastES2019jsdiffparsercommandmimetypesdotenviterationclass-validatorObject.valuesemrratephoneemitcryptrm -frArrayBufferflatMapsequencewrapwatchhashcss lesslogginghttpArray.prototype.findLastIndexlruStreampromiseredactpolyfilll10nasserttostringtagieenvECMAScript 3parentECMAScript 2023awesomesaucepreprocessorObject.definePropertyfseventssestrimLeftdeepcloneextendloadbalancingjsonbytetestingpluginpropfast-copyhttpsexpressObjectES3JSON-SchemafindLastfind-upECMAScript 2017arraybreakWebSocketsamazonES6ES2016nativeprotobufwebinstallUint8ClampedArraymakefunctionsreusegetintrinsic
1.2.27

1 year ago

1.2.28

1 year ago

1.1.19

1 year ago

1.2.29

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.23

1 year ago

1.1.22

1 year ago

1.1.21

1 year ago

1.1.20

1 year ago

1.1.27

1 year ago

1.1.26

1 year ago

1.1.25

1 year ago

1.1.24

1 year ago

1.1.16

1 year ago

1.1.12

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago