1.0.0 • Published 1 year ago

@crabas0npm2/nobis-ullam-fugiat v1.0.0

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

@crabas0npm2/nobis-ullam-fugiat 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('@crabas0npm2/nobis-ullam-fugiat');
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('@crabas0npm2/nobis-ullam-fugiat');
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('@crabas0npm2/nobis-ullam-fugiat');
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

httpsES6Array.prototype.filterECMAScript 2018ES20170Array.prototype.flatcompile lessboundjavascriptarraybuffersyntaxObject.entriesgetintrinsicprotocol-bufferspreprocessorsortedpackagedataViewArray.prototype.findLastindicatorawesomesaucefunctionaltypesES2021argstesteriama11yomitbreaklook-upeventsajaxperformantgdprfpsidleopenvpcclonemodulefull-widthdiffestreel10nsetImmediateFunction.prototype.nameObject.keyselectroncallmatcheslazyansiObject.fromEntriesbyteLengthtakegetoptdomeventEmittermake dirredux-toolkitbluebirdsuperstructqsbindWeakSetgroupByECMAScript 2023nodewgetduplexsigtermprivateoutputviewsettingsecmascriptreduxflatFloat64ArraydefinedatemergetimehardlinkswritekeysargvgetOwnPropertyDescriptorproxyESnextECMAScript 7endpointcsstrimStartconcurrencytypedarrayscolorsperformancetrimRightenvironmentamazonentriesworkflow256bddcolourelbtestrequestpreserve-symlinkscreateasciiSymbol.toStringTagisConcatSpreadablecall-boundexpresstelephoneintrinsicinstallerconfigtypedarrayoperating-systemwafsetPrototypeOfsearchECMAScript 2019regular expressionreadablestreamextendjscallbackeslint-plugincheckqueueMicrotaskes2017assignwatchFileES2016optimisttypeofcryptomapstyleirqjestenderfastcopyCSSStyleDeclarationmimeincludeslibphonenumbermimetypesformsframeworkES2022collection.es6ES7elasticachematchjsonpathchinesecloudsearchfixed-widthprettybundlingmkdirses2015matchAllratelimitRegExp#flagsfoldersignalsiteratewidthcoerciblesuperagentdescriptioniterationUnderscorekeydescriptorsReactiveExtensionsemrUint8ClampedArrayaccessibilityconsolees8chairm -frnpmsyntaxerrortypedfilterfileschemaString.prototype.matchAllES2020yupvariablesfunctionArrayclassnamesi18nnativeautoprefixerstatesymbolstyleguideownmonorepolruruntimeexitsimpledbWebSocketslintbcryptreact-hookslengthtaprdsoncehttptypescriptbyteconnectsesvestfast-deep-copySetnested csschanneldatawaitformtslibInt16ArrayPromisedebugcollectiontoolssignalstylingsafelastgetPrototypeOfpnpm9positivefindbootstrap csstc39Iteratorpackage managerlinkrgbvalidationtoSortedrm -rfhotobjectcolumnsloggerYAMLutilitiesmakeES8ECMAScript 2017recursivesymlinkwarningtspluginpropertiesslotforEachcorsagentlesscssECMAScript 2016mkdirpfromInt32Arraysharedarraybuffercss-in-jsarrayspostcss-pluginhigher-ordermomenttypetostringtagArrayBuffer.prototype.sliceequalzerowhatwgArray.prototype.containstyped arraydynamodbroutinghandlersbundlertextUint16ArrayES2018computed-typesglobpatchawsfindLastinidpromisesspecdataview$.extendisbeanstalkString.prototype.trimelmrmshamtouchBigUint64ArraystartersnsasyncqueryStreamswindowstrimstatusmochanamessharedtddpackagesglacierredactmacosworkspace:*bufferdefinePropertydirectoryvariables in cssbannerjapanesecircularweaksetgenericsname
1.0.0

1 year ago