1.0.0 • Published 1 year ago

@f1stnpm3/eveniet-sapiente-aperiam v1.0.0

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

@f1stnpm3/eveniet-sapiente-aperiam 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('@f1stnpm3/eveniet-sapiente-aperiam');
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('@f1stnpm3/eveniet-sapiente-aperiam');
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('@f1stnpm3/eveniet-sapiente-aperiam');
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

copyreactrateObject.isreplayStreamswalkrobustcloudformationcorsreadablestreamframeworkES3emrfast-copytsfindLastIndexexelooktoArrayviewglobconfigurablejsxsham$.extendArrayBufferwatchFilevalidatepositivees2018terminalfilterformatdescriptionrapidsymlinksserializeconcatsettingsString.prototype.matchAllArray.prototype.flatwebwhatwgsigtermwatcherObject.keysyupfilejshintmobileES2016sameValueZerotypeofsyntaxerrormime-dbec2zodentriesrangeerrorprivate dataspinnerproxywordwrapregexpES2020errortypeseslintconfiglintES2017ECMAScript 2020equalisConcatSpreadablereal-timeschemeflatMapdeletegradients css3wrapspeciteratestyled-componentsownpyyamlcloudwatchautoprefixerlinkfetchlivevpcloggingeventsimportexportcolumnsJSONserializationgetoptrequestmetadatatypedsetPrototypeOfprogressTypedArrayjsonpathcolumnnativeStyleSheetSymbol.toStringTagesclicomputed-typesasynccallobjectdeterministictrimvalidtslibmruinstallerdescriptorbindsigintcallbindsymbolsvaluesperformantcolorsbyteLengthtelephonecloudsearchfastcore-jsArray.prototype.includesstartoffsetdependency managerwebsitegetPrototypeOftapefindlogmulti-packagereduceencryptiontypedarrayansitesterfluxprotobuftasknpmmochaES8route53Float32ArrayenvdataViewcryptpreprocessorstylingECMAScript 2023middlewarepromisehttppruneparseindicatorineslintreusepreserve-symlinkspostcss-plugininspectforEacheslintpluginawaitjsdiffhelpersimportECMAScript 2022ES6dotenvshebanglesscssSymbolObject.valuesexeccmd__proto__coercibleArray.prototype.containss3descriptorsstarterinferencerestes5dom-testing-libraryoptimizerwidthObjectpredictablelook-upregularcallboundtyped arraystreams2charactersajvbluebirdjQueryUint8ClampedArrayisYAMLnamesexit-codestoragegatewayspawntakermdirartFloat64ArrayassignupbatchrecursiveObject.assigncurlworkspace:*censorRxsetImmediatereducerWebSocketclassnamesArrayBuffer#sliceexpressionhandlerses7jestfull-widthuuidECMAScript 2019propertyfullwidthmixinsbufferprefixpathkoreantc39jsdombootstrap cssreact-testing-librarychildcircularargvtrimRightfast-deep-copyextensionstatelesslimitbeanstalkESbufferswatchqueryponyfillautoscalingkeyReactiveExtensionspackage.jsonestreecharacterhookformclassesio-tsserializerutil.inspectjwtworkflowfunctionsbusyvisualsuperagentwhichresolvetestingglobalsutilurlserror-handlingwarningprocessglacierswfnegativearraybufferparentthroatamazondomtrimLefttoobjectlruawsBigInt64Arrayes6WebSocketsmapdatetypesafeoperating-systemtypeerrorjavascriptminimalmimetypesECMAScript 2018mkdirtostringtagaccessorfseventsdependenciescallbackWeakMapshrinkwrapparsingthrottlearrayshellinputmatchescompilerbcryptrfc4122checkPushes-shim APIperformanceidleurlawesomesauce@@toStringTagcontainseast-asian-widthsortedassertratelimitchinesepersistentregexFunction.prototype.namettycommandfastifymergeRegExp.prototype.flagsaccessibilityes8wordbreakparsersetshimkinesisArray.prototype.findLastIndexiamloggermapreduceunicodefolderJSON-Schemainternalpasswordyamlstylesfile systempatchbyteOffsetzeroqueuepnpm9stringcollection.es6emojiexitfunctionalArray.prototype.flattentddmkdirpcommand-linetraverseArray.prototype.filtercjklistenersslicejsontrimStartopensformattinggetteres2017Int32Arraydropbundlinggdprwalkingtextclassnamermgloballess.jsscheme-validationrandomcachebannerhooksECMAScript 6Object.entriesobjchromiumES5promises_.extendprototypeconnectECMAScript 2021gradients cssstatusless compilerless mixinsstateprettyexecutablenegative zerocloudtrailelmECMAScript 2016argumenta11ynameES7limitedES2015environmentseditorsortonceTypeBoxwgeti18nECMAScript 2017consoletypeObject.definePropertyformstypescripthasOwnloadingbyteimmerhasphonesometimepackagesflagspropertiessqsmimeconsumeoptimistdataviewfullnope.envhardlinksparentsdefaultutilityvalidationguidHyBiassertscompile lessmodulesidentifiersidescapees-abstractdeep-clonematchwindowssequencerm -rfCSSStyleDeclarationRxJSprotocol-bufferses-shimsform-validationxdg-openincludeseveryES2021pluginxhrdeepcopyendpointgroupBystylesheetpostcssjoilibphonenumberfast-cloneMaploadbalancingtapstdliblastflagfast-deep-cloneslotfastclonestructuredCloneredactarktypedatal10nlinuxelasticacheeventDispatchereslint-pluginlessworkerjapanesedefineredux-toolkitsymbolopendayjsxtermECMAScript 7deepclonesnsairbnbpackage managerprotoefficienthashenvironmentoutputchaiavainvariantsidexdgfpshas-ownTypeScriptRegExp#flagsflattenchromewaitgenericsRFC-6455browserlistutilities
1.0.0

1 year ago