arc-object
Advanced tools
Comparing version 1.1.0 to 1.2.0
13
index.js
@@ -216,2 +216,6 @@ "use strict"; | ||
constant(_key,_val,_enumerable){ | ||
ArcObject.defineConstant(this,_key,_val,_enumerable); | ||
} | ||
//To string: [object ArcObject] | ||
@@ -261,4 +265,13 @@ toString(){ | ||
} | ||
static defineConstant(_obj,_key,_val,_enumerable){ | ||
Object.defineProperty(_obj, _key, { | ||
value: _val, | ||
writable : false, | ||
enumerable : (_enumerable === false ? false : true), | ||
configurable : false | ||
}); | ||
} | ||
} | ||
module.exports = ArcObject; |
{ | ||
"name": "arc-object", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "An object convenience subclass", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -155,2 +155,5 @@ # arc-object [![Build Status](https://travis-ci.org/anyuzer/arc-object.svg?branch=master)](https://travis-ci.org/anyuzer/arc-object) | ||
### .constant(key:Mixed,val:Mixed[,enumerable:Boolean]) | ||
Alias of static ArcObject.defineConstant() | ||
### .quickFilterKeys(values:Array) / .quickFilterVals(values:Array) | ||
@@ -187,2 +190,13 @@ Remove indexes from object based on either matching keys, or matching values. | ||
### ArcObject.defineConstant(obj:Object,key:Mixed,val:Mixed [,enumerable:Boolean]) | ||
This is a convenience static method that does the following: | ||
```js | ||
Object.defineProperty(obj, key, { | ||
value: val, | ||
writable : false, | ||
enumerable : (enumerable === false ? false : true), | ||
configurable : false | ||
}); | ||
``` | ||
## Testing | ||
@@ -189,0 +203,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23305
14
493
203