5.12.113 • Published 10 months ago

@taktikorg/minus-alias-culpa v5.12.113

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

@taktikorg/minus-alias-culpa Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Define multiple non-enumerable properties at once. Uses Object.defineProperty when available; falls back to standard assignment in older engines. Existing properties are not overridden. Accepts a map of property names to a predicate that, when true, force-overrides.

Example

var define = require('@taktikorg/minus-alias-culpa');
var assert = require('assert');

var obj = define({ a: 1, b: 2 }, {
	a: 10,
	b: 20,
	c: 30
});
assert(obj.a === 1);
assert(obj.b === 2);
assert(obj.c === 30);
if (define.supportsDescriptors) {
	assert.deepEqual(Object.keys(obj), ['a', 'b']);
	assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'c'), {
		configurable: true,
		enumerable: false,
		value: 30,
		writable: false
	});
}

Then, with predicates:

var define = require('@taktikorg/minus-alias-culpa');
var assert = require('assert');

var obj = define({ a: 1, b: 2, c: 3 }, {
	a: 10,
	b: 20,
	c: 30
}, {
	a: function () { return false; },
	b: function () { return true; }
});
assert(obj.a === 1);
assert(obj.b === 20);
assert(obj.c === 3);
if (define.supportsDescriptors) {
	assert.deepEqual(Object.keys(obj), ['a', 'c']);
	assert.deepEqual(Object.getOwnPropertyDescriptor(obj, 'b'), {
		configurable: true,
		enumerable: false,
		value: 20,
		writable: false
	});
}

Tests

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

dependency managertsserializertypepnpm9mruextensionUint8ArrayECMAScript 6typeofwebRxJSfullwidthpopmotionebsTypedArrayArray.prototype.filterpyyamlapiconverttrimflatMapcore-jsreact-testing-librarycircularjsonpathtelephonecommand-lineJSONdayjsttyobjectString.prototype.trimreduxfindupreusei18nfindLastfast-deep-cloneroute53xdgcoerciblepushmakegetterRxenderrmdirnumberpersistentwaittapebrowserexpressionpackagestrimStartprunequotesuperstruct.envdeterministicWebSocketsES2021reactisConcatSpreadableglobalsfile systemrecursivereducepackage.jsonjsxArray.prototype.flatMapESworkspace:*npmPushobjgroupByformminimaltddserializegenericses2015react animationstringifyreact-hook-formslicelogpreserve-symlinksenvironmentsutilitieskinesisyamlinprotocol-bufferscallbackdataviewparserispolyfillcomputed-typesestreeloadbalancingenvnopebundlingpropertieshigher-orderansiwritableES2023piperegular expressionoutputfsArray.prototype.flattenuuidarraybuffercopyArray.prototype.flatsettervalueprivate datawidthES5Array.prototype.findLastextendimportexportdiffjQuerycommanderemitconcatlaunchReflect.getPrototypeOfpostcss-pluginqueuetoolkitmime-dbObject.getPrototypeOfdefaultshellajvStyleSheetsetsqslocationartespreerandomanimationArrayBuffer.prototype.slicefetchperformantReactiveExtensionsprotooptimizertextweakmap0jsdiffhttptoolses-abstracteventDispatcheresqsquerystringprogressnegativeJSON-SchemastreamsconcatMapclass-validatordeepvarsArrayBuffer#slicesyntaxerrorrds_.extendregexdirectorysomeduplexieMicrosoftwordwrapa11ynametypedidleoncetraverseswfconsolejoiArrayBufferelasticachestyled-componentslinkassignvaluesdeep-copyECMAScript 2020mkdiraccessibilitysetPrototypeOfcsscmdfind[[Prototype]]autoprefixerterminaldomtostringtagmergeECMAScript 2016trimEndpackage managerworkerlook-upStreamreadchromees8environmentendpointwhatwgthroatcodescolumnsfilterenumerablesortfastcall-bindroutingcloudwatchfast-copyresolvetyped array$.extenderroreslintconfigdom-testing-libraryes2018rgbhelpermetadatadescriptorsspawnchromiumArrayremovetypanionintrinsiclengthES6descriptioncallfixed-widthstreamjavascriptArray.prototype.includesrequestbuffersequalopenRegExp#flagsfullcloudsearchcompilersetImmediatematchesbyteOffsetredux-toolkites-shimspostcssoptionimportmatchexecutablelinttimeString.prototype.matchAllxhrjapaneseES2016sidel10nbusyUint8ClampedArraycallboundes-shim APIiteratorurlselectronCSSStyleDeclarationchanneltypeerrordescriptorhardlinksCSSHyBiopensgetOwnPropertyDescriptorposesharedrapidES2022RegExp.prototype.flagsAsyncIteratorargstoSortedRFC-6455dataframeworkeslint-pluginprocessreact-hooksavabddchecklasttouchinternal slotES8invariantreadablepackagewalkingregular expressionsruntimetestdragtypedarraysstringstarterprettyshimvestsymboleslintkeysweaksetFunction.prototype.nameeslintplugines5nodefunctionsimmerpluginbluebirdmapES2017-0charactersformsinternalfast-cloneexecyupsymbolsperformanceargumentsdeepcloneschemaschemetoobjectthrottlexdg-openopenerspinnercompareratelimitgroupwaapiowniamsafesymlinksESnextvalidationTypeScriptsameValueZeroUint32ArraycensorassertionzerodeepcopyindicatorECMAScript 2022fast-deep-copyObservableclielbpropequalityBigUint64ArrayzodpatchhookformcharsetArray.prototype.containsutilityObject.keysfindLastIndexinstallasyncnativeregularlimitedupmodulethreecolorrm -frcollectionmatchAllextraawsinspectairbnbObjectpositivespecwritehasOwnPropertytypescriptECMAScript 3URLSearchParamsprotobufES2020jshintrateargparseflagsmapreduceinferenceflatstartescapepathmkdirptakeastdependencieslimititerationcryptolookes7multi-packageObservableswafreact poseinstallerUint16ArrayReactiveXformatgdprECMAScript 2023languageeditorredirectpicomatchTypeBoxtaskuninstallagentworkflowqueryglobalcollection.es6httpssettingssymlinkarraystatelessfastifyprefixtoArraySymbolponyfillhash
4.9.102

11 months ago

3.2.24

1 year ago

4.9.103

11 months ago

3.2.23

1 year ago

3.2.26

1 year ago

3.2.25

1 year ago

3.2.28

1 year ago

3.2.27

1 year ago

4.9.100

11 months ago

4.9.101

11 months ago

3.2.29

1 year ago

3.2.20

1 year ago

3.2.22

1 year ago

3.2.21

1 year ago

5.12.113

10 months ago

4.10.103

11 months ago

3.2.35

1 year ago

3.2.34

1 year ago

3.2.37

1 year ago

3.2.36

1 year ago

3.6.77

12 months ago

3.2.39

1 year ago

3.6.76

12 months ago

3.2.38

1 year ago

3.6.75

12 months ago

3.6.74

12 months ago

4.7.81

12 months ago

4.7.82

12 months ago

4.10.104

11 months ago

4.7.85

11 months ago

3.2.31

1 year ago

4.10.105

11 months ago

4.7.86

11 months ago

3.2.30

1 year ago

4.10.106

11 months ago

4.7.83

11 months ago

3.2.33

1 year ago

4.7.84

11 months ago

3.2.32

1 year ago

3.6.73

12 months ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.15

1 year ago

3.3.58

1 year ago

3.3.59

1 year ago

3.5.73

12 months ago

4.8.87

11 months ago

4.8.86

11 months ago

4.8.89

11 months ago

4.8.88

11 months ago

3.5.72

12 months ago

3.5.71

12 months ago

3.5.70

12 months ago

4.11.106

11 months ago

3.2.19

1 year ago

3.3.60

1 year ago

3.3.61

1 year ago

3.3.62

1 year ago

3.3.63

1 year ago

5.11.112

10 months ago

5.11.111

10 months ago

5.11.113

10 months ago

5.11.110

10 months ago

4.6.80

12 months ago

4.6.81

12 months ago

5.11.109

10 months ago

5.11.108

10 months ago

5.11.107

11 months ago

5.11.106

11 months ago

3.5.69

12 months ago

3.5.68

12 months ago

3.5.67

12 months ago

3.5.66

12 months ago

3.5.65

1 year ago

3.5.64

1 year ago

4.8.90

11 months ago

3.5.63

1 year ago

4.8.92

11 months ago

4.8.91

11 months ago

2.2.19

1 year ago

4.6.77

12 months ago

4.6.78

12 months ago

4.6.79

12 months ago

3.2.46

1 year ago

3.2.45

1 year ago

3.2.48

1 year ago

1.2.18

1 year ago

3.2.47

1 year ago

1.2.19

1 year ago

3.2.49

1 year ago

4.9.93

11 months ago

4.9.92

11 months ago

4.9.95

11 months ago

3.4.63

1 year ago

3.2.40

1 year ago

4.9.94

11 months ago

4.9.97

11 months ago

3.2.42

1 year ago

4.9.96

11 months ago

3.2.41

1 year ago

4.9.99

11 months ago

3.2.44

1 year ago

4.9.98

11 months ago

3.2.43

1 year ago

3.2.57

1 year ago

3.2.56

1 year ago

3.2.58

1 year ago

3.2.51

1 year ago

3.2.50

1 year ago

3.2.53

1 year ago

3.2.52

1 year ago

3.2.55

1 year ago

3.2.54

1 year ago

1.2.13

1 year ago

1.2.14

1 year ago

1.2.9

1 year ago

1.2.12

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.1.9

1 year ago

1.1.8

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.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago