2.1.9 • Published 4 months ago

@juigorg/at-ipsam v2.1.9

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

@juigorg/at-ipsam Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ES2017 spec-compliant shim for Object.getOwnPropertyDescriptors that works in ES5. Invoke its "shim" method to shim Object.getOwnPropertyDescriptors if it is unavailable, and if Object.getOwnPropertyDescriptor is available.

This package implements the es-shim API interface. It works in an ES3-supported environment and complies with the spec.

Example

var getDescriptors = require('@juigorg/at-ipsam');
var assert = require('assert');
var obj = { normal: Infinity };
var enumDescriptor = {
	enumerable: false,
	writable: false,
	configurable: true,
	value: true
};
var writableDescriptor = {
	enumerable: true,
	writable: true,
	configurable: true,
	value: 42
};
var symbol = Symbol();
var symDescriptor = {
	enumerable: true,
	writable: true,
	configurable: false,
	value: [symbol]
};

Object.defineProperty(obj, 'enumerable', enumDescriptor);
Object.defineProperty(obj, 'writable', writableDescriptor);
Object.defineProperty(obj, 'symbol', symDescriptor);

var descriptors = getDescriptors(obj);

assert.deepEqual(descriptors, {
	normal: {
		enumerable: true,
		writable: true,
		configurable: true,
		value: Infinity
	},
	enumerable: enumDescriptor,
	writable: writableDescriptor,
	symbol: symDescriptor
});
var getDescriptors = require('@juigorg/at-ipsam');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is not present */
delete Object.getOwnPropertyDescriptors;
var shimmedDescriptors = getDescriptors.shim();
assert.equal(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));
var getDescriptors = require('@juigorg/at-ipsam');
var assert = require('assert');
/* when Object.getOwnPropertyDescriptors is present */
var shimmedDescriptors = getDescriptors.shim();
assert.notEqual(shimmedDescriptors, getDescriptors);
assert.deepEqual(shimmedDescriptors(obj), getDescriptors(obj));

Tests

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

readableimmerstylesmanageruuidmanipulationtextmatchObject.fromEntriesES2020serversetECMAScript 5URLObservablescolormulti-packageuninstall$.extendautoscalingregularfilterrequestsymbolsincludesmapreduceinferencecharacterpreprocessorreadablestreamfastrgbmobiletoStringTaggetPrototypeOfjavascriptcallbackjson cachewalkObject.entriestoolsworkersource mapECMAScript 2021figletbufferSymbolcommand-linecloudfrontassignreducerresolvereact-testing-librarytrimRighttrimLeftsqsdeepcopyinstallwgetrm -rfhasOwnPropertyMicrosoftprotocol-bufferses2017functionalECMAScript 7yamlutilsfileavapluginxtermsortedmatchAlljestqsexecuteReflect.getPrototypeOfbundlerMaphas-owntermschemaswfbddxhremrintrinsichttpslanguagefunction.lengthsyntaxES7rssString.prototype.trimframeworkinstallerexeccjkkey valueweaksetio-tsparentsfast-deep-copyjsxzodroutingserializationpackage managerstringifywhatwgargsindicatorapolloproxyhelperArray.prototype.flatMapECMAScript 2018icuqueueeventEmitterpackagesastsetPrototypeOfECMAScript 2019regular expressionvalueschromerangeerrorgdprnegative zerorestECMAScript 6route53taptoSortedservicechildbeanstalkbyteOffseturlstreamerrorUint16ArraydiffgetOwnPropertyDescriptormomentpinoutil.inspecttyped arrayeventDispatcherprettyponyfilllocaldotenvcallboundebsloggingsimpledbemitsubprocessarraybufferArrayBuffer.prototype.sliceperformantfpfastcopypolyfilldeterministicStyleSheetES2016jsonES2015browserreact animationdomawsinputArray.prototype.findLastawesomesaucejapaneserm -frutilitiescurriedl10ntypesafeArrayBuffermatchestoArrayPush[[Prototype]]censorclassesa11ysearchsymlinksstripboundinstrumentationtypedarrayfantasy-landreduxkeysrmES2017xmllogamazon__proto__picomatchsameValueZerovalidESnextscheme-validationnegativeECMAScript 3prototypebannerformattingES2023serializeutilitylintownsetterrouteArraybusyassertsoptimizerlockfileArrayBuffer#slicewafBigUint64ArrayObject.isjasminecharactersArray.prototype.findLastIndexredirectdeep-copyInt8ArraydynamodbeslintconfigjQuerydebuggerECMAScript 2023espreeconsolereacttraverseStreamsappextendstringSetfront-endoffsetsharedwebredactparseriteratefile systempropertysetImmediateObject.definePropertyreact posestyleconvertcallbindmapeslintes7Uint32Arrayfast-deep-clonespringmakeenumerablereversewaapitrimStartCSSStyleDeclarationmake dirglaciergetintrinsicmkdirstypesoptionec2warningYAMLaccessorclientmruexpressionelasticachetoReversedcloudtrailwhichObjectmochafnmatchescapetimeObservablecode pointsviewexecfileform256walkingcorefunctiongraphqllastcoercibleprefixnamecheckformatdependency managerspinnerflatbindshamterminalregular expressionsrobustidentifiersmetadatastableRegExp.prototype.flagshasi18ntoolkitsuperstructobjectshellsortECMAScript 2022hardlinkstsgenericsObject.assignes-abstractregexpString.prototype.matchAllES6asteriskscachesuperagentparentnamescommanderwaitpromiseenvironmentspropertiesjsdomUint8Arrayfixed-widthincolumnjsdiffupconcattransformhooksdescriptorsbinariesmockaccessibilityspeedrestfulgetpopmotioncontainsmockingpackagearraycurltakeUint8ClampedArrayeffect-tsfindLastIndexdeepatomfindupqueueMicrotaskvest.envObject.valueskey parnodereal-timecopyexpressArray.prototype.flatformsform-validationisConcatSpreadableextrakoreanjshintnodejsstylingcompileres2015globalstacitworkspace:*sinatraFloat64ArraycolumnsconcatMapArray.prototype.filtercssfindLastkeyFloat32ArraykinesisconfigdataprogressfastifyJSONargumentrfc4122ajvtslibprotobufwriterapidcss-in-jsTypedArraychaifind-updescriptorcloudsearchcirculargetoptramdakarmaRxJSassertionajaxmodulescomputed-typesimportvalidatePromiseReactiveExtensionsrdsspecschemetransportinvariantstringifierfetchentriesfastclonegroupByTypeBoxstarternpmdebugECMAScript 2015readcompareelbES2021typescripteverybrowserslistCSSmergelook-upidleeast-asian-widthfast-clonedirenv@@toStringTagassertmoveargvbinlinkbufferslocationquerystringregular-expressiontesterlookcloudformationpropJSON-SchemaairbnbUnderscorehttpsesnpmignoreWebSocketvarsreact-hookssnsautoprefixerworkflowgesturespipewidthsomereversed0removeweakmapparseoutputhelperscloudwatchbinaryasyncpurelrugrouptestingloggerconfigurableTypeScriptcrypto_.extendES2018flattenecmascriptchanneleslint-plugingetterdeepclonedirectoryvpcpathclonespawnfast-copys3arktypefeedfolderimmutabletypedenderdom-testing-libraryfile cachees5forEacheslintpluginequalityreworkdeleteRFC-6455slotES8unicodefullwidthWebSocketsbrowserlistzerozxdataViewRxECMAScript 2016dependencieschromiumes2018styled-componentsvalueiamiscodesbytejoiregexprunetypeerrorWeakMaphandlershrinkwrapECMAScript 20173dsharedarraybufferfindtranspilerrequireefficientreuseemojisyntaxerroronceflagsclassnameinternal slotmkdirpflatMaptestes-shimsIteratorcolourprivateuser-streamsnumbersimple cacheequalthreeES2022gitignorecreatestructuredCloneartiteratorpoint-freehtmltoobjectAsyncIteratorcoverageloadbalancingfull-widthtc39call-boundpatchvariablesHyBipushfromglobhasOwnignoreguidesshebangqueryrmdirforkprotoURLSearchParamsfpsES3positiverecursiveobjclijs.gitignoreArray.prototype.flattenchinesehashes6Array.prototype.includesdescriptionnopeBigInt64Arrayreduceprocessfunctions-0framerlistenersslicelibphonenumberhigher-orderstyleguidedefinetypeofclassnameswritableoptimistbundlingpyyaml
2.1.9

4 months ago

2.1.8

4 months ago

2.1.7

4 months ago

2.1.6

4 months ago

2.1.5

4 months ago

2.1.4

4 months ago

2.1.3

4 months ago

2.1.2

4 months ago

2.1.1

4 months ago

2.0.1

4 months ago

2.0.0

4 months ago

1.0.0

4 months ago