Methods
addProps(…arr) → {Object}
Add values of properties which are common between all objects, others remain as it is.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array.<AlterSet>
|
Array.<Object>
|
<repeatable> |
Array of objects to add properties of |
Returns:
- Type:
-
Object
- Values will be sum of individual values of passed object
get(key, dopt) → {*}
Return default value if property not found
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
String
|
Property to search for |
||
d |
*
|
<optional> |
null |
Value to return in case of miss |
Returns:
- Type:
-
*
- Value against a Key in the object
getMax() → {Array}
Get key of maximum value
- Source:
Returns:
- Type:
-
Array
- Array of keys with the maximum value
getMin() → {Array}
Get key of minimum value
- Source:
Returns:
- Type:
-
Array
- Array of keys with the maximum value
hasKey(key) → {Boolean}
Intuitive way of checking key existence
- Source:
Parameters:
Name | Type | Description |
---|---|---|
key |
String
|
Key to check existence of |
Returns:
- Type:
-
Boolean
- True/False
intersection(arr, optionsopt) → {Object}
Create an object with values from existing object and properties specified in array.
- Source:
Parameters:
Name | Type | Attributes | Default | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arr |
Array
|
Properties array. |
|||||||||||||||||
options |
Object
|
<optional> |
{unref:true, protoLookup:true} |
Object containing control params
|
Returns:
- Type:
-
Object
- An object with keys which are passed in array.
json() → {String}
Get JSON representation of the object
- Source:
Returns:
- Type:
-
String
- Object to JSON
sort(optionsopt) → {Array}
Get array of keys, in Ascending or Descending order of values
- Source:
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
Object containing control params
|
Returns:
- Type:
-
Array
- Either array of
keys
orvalues
based on value of returns
subProps(…arr) → {Object}
Subtract values of properties which are common between all objects, others remain as it is.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array.<AlterSet>
|
Array.<Object>
|
<repeatable> |
Array of objects to subtract properties of |
Returns:
- Type:
-
Object
- Values will be
Instance Value
-Sum of passed object values
of individual values of passed object
union(obj, optionsopt) → {Object}
Create an object with key, value pairs in both objects, overring with the pairs of passed object
- Source:
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
obj |
AlterSet
|
Object
|
Object to append key value paris of |
||||||||||||
options |
Object
|
<optional> |
{unref:false} |
Object containing control params
|
Returns:
- Type:
-
Object
- An concatinated object
Instance
UPassed Object
withValue(value, options) → {Array}
Find keys having a certain value
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
value |
String
|
Number
|
Value to search the keys for |
||||||
options |
Object
|
Object with control params
|
Returns:
- Type:
-
Array
- Array of keys matching a certain value