The namespace for all UF/Object utility functions, typically for static methods.
- Source:
Methods
(static) add(arg0_object, arg1_value) → {Object}
Adds a value to an object, recursively.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
arg1_value |
number
|
The value to add to each variable in the object. |
Returns:
- Type:
-
Object
(static) addGetterSetter(arg0_object, arg1_variable_string, arg2_optionsopt) → {Proxy}
Adds a getter/setter to a given variable string with a root object.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||||
arg1_variable_string |
string
|
||||||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Proxy
(static) addObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}
Adds values between two objects, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The 1st object to pass. |
|||||||||||
arg1_object |
Object
|
The 2nd object to pass. |
|||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) changeRange(arg0_object, arg1_key, arg2_min_max_argumentopt, arg3_value) → {Object}
Changes object ranges, non-recursively, for a given key.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
||
arg1_key |
string
|
The key corresponding to the range to modify. |
||
arg2_min_max_argument |
string
|
<optional> |
"both" |
Either 'minimum'/'maximum'/'both'. |
arg3_value |
number
|
The number to change these ranges by. |
Returns:
- Type:
-
Object
(static) clean(arg0_object, arg1_optionsopt) → {Object}
Removes both zero values and undefined/null values from an object by default.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) computeNegativeDiff(arg0_prev_obj, arg1_next_obj) → {Object}
Computes object-level diff. Returns only the keys of 'prev_obj' whose values differ from or are absent in 'next_obj'. This is what gets stored in every non-head keyframe.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_prev_obj |
Object
|
|
arg1_next_obj |
Object
|
Returns:
- Type:
-
Object
(static) concat(arg0_object, arg1_object) → {Object}
Recursively merges two objects, but only on undefined keys.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
||
arg1_object |
Returns:
- Type:
-
Object
(static) createSearch(arg0_optionsopt) → {function}
Creates a function to search an object regularly using a substring. Similar to Object.createSmartSearch, but creates a 'relevancy index' for each potential entry and affixes them to a return object.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_options |
Object
|
<optional> |
|
Returns:
- Type:
-
function
(static) createSmartSearch(arg0_optionsopt) → {function}
Defines a smart search function off of which various attributes are checked in a specific order, both soft and hard.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_options |
Object
|
<optional> |
|
Returns:
- Type:
-
function
(static) cubicSplineInterpolation(arg0_object, arg1_optionsopt) → {Object}
Performs a cubic spline interpolation operation on an object.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
|||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) cubicSplineInterpolationDomain(arg0_object) → {Object}
Performs cubic spline interpolation over the entire Object domain.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) deleteSmartSearch(arg0_name)
Deletes a smart search function.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_name |
string
|
The .function_name of the smart search to delete. |
(static) divide(arg0_object, arg1_value) → {Object}
Divides an object by a value, recursively.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
arg1_value |
number
|
The value to divide each variable in the object by. |
Returns:
- Type:
-
Object
(static) divideObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}
Divides two objects, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The 1st object to pass. |
|||||||||||
arg1_object |
Object
|
The 2nd object to pass. |
|||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) expandValue(arg0_object, arg1_optionsopt)
Expands a target value to its natural [min, max] boundaries, i.e. zero-values.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object.<number>
|
||||||||||||||||||||||
arg1_options |
Object
|
<optional> |
|
(static) flatten(arg0_object) → {Object}
Moves all keys into the 1st nesting.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) generateRandomID(arg0_object) → {string}
Generates and returns a random unique ID given a specific object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
string
(static) getAverageDeviationFromObject(arg0_object, arg1_object) → {number}
Calculates the average deviation of one object from another based on domain.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
|
arg1_object |
Object
|
Returns:
- Type:
-
number
(static) getDepth(arg0_object, arg1_depthopt)
Returns object depth as a number.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
arg0_object |
Object
|
The object to fetch depth for. |
||
arg1_depth |
number
|
<optional> |
1 |
Optimisation parameter used as an internal helper. |
(static) getDomain(arg0_object) → {Array.<number>}
Returns the Object domain with [min, max] numbers.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Array.<number>
(static) getList(arg0_object_list) → {Array.<any>}
Returns the Object as an array list.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object_list |
Object
|
Returns:
- Type:
-
Array.<any>
(static) getMaximum(arg0_object, arg1_optionsopt) → {number}
Fetches the maximum value within an object.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
number
(static) getMinimum(arg0_object, arg1_optionsopt) → {number}
Fetches the minimum value within an object.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
number
(static) getNearestNegativeNumberToValue(arg0_object, arg1_key) → {number}
Returns the nearest negative number in an Object from a given value.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
|
arg1_key |
string
|
Returns:
- Type:
-
number
(static) getNearestPositiveNumberToValue(arg0_object, arg1_key) → {number}
Returns the nearest positive number in an Object from a given value.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
|
arg1_key |
string
|
Returns:
- Type:
-
number
(static) getSubobject(arg0_object, arg1_key, arg2_restrict_search) → {Object}
Fetches a subobject.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
arg1_key |
string
|
The key to recursively look for to fetch the local subobject. |
arg2_restrict_search |
boolean
|
Whether to restrict the search to the 1st layer. |
Returns:
- Type:
-
Object
(static) getSubobjectKeys(arg0_object, arg1_optionsopt) → {Array.<string>}
Fetches the keys in a subobject that match the given criteria.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Array.<string>
(static) getSum(arg0_object, arg1_optionsopt) → {number}
Fetches the object sum, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
|||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
number
(static) getValue(arg0_object, arg1_variable_string) → {string}
Fetches a given value with a root object and variable string.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
|
arg1_variable_string |
string
|
Returns:
- Type:
-
string
(static) hasKeys(arg0_object, arg1_keys, arg2_optionsopt) → {boolean}
Determines whether an object has all the keys mentioned.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||
arg1_keys |
Array.<string>
|
||||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
boolean
(static) interpolateGT(arg0_object, arg1_object)
Interpolates and normalises data given an absolute Ground Truth (GT) and an absolute, but relativistic rates map.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object.<number>
|
The Ground Truth (GT) map |
arg1_object |
Object.<number>
|
The Relativistic Rates (RR) map |
(static) interpolateNegatives(arg0_object) → {Object}
Interpolates negative values by carrying over the last positive value found.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) invertFraction(arg0_object) → {Object}
Inverts a fraction object, fetching the reciprocal of percentage values (1 - n).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
Returns:
- Type:
-
Object
(static) iterate(arg0_object, arg1_function, arg2_optionsopt)
Iterates over an object, with similar conventions to other Object static methods.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
|||||||||||||||||||||||||
arg1_function |
function
|
function
|
|||||||||||||||||||||||||
arg2_options |
Object
|
<optional> |
|
(static) linearInterpolation(arg0_object, arg1_optionsopt) → {Object}
linearInterpolationObject() - Performs a linear interpolation operation on an object.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to perform the linear interpolation on. |
||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) mergeObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}
Merges two objects together.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||||||||||||
arg1_object |
Object
|
||||||||||||||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) modifyRanges(arg0_object, arg1_value, arg2_optionsopt) → {Object}
Modifies ranges in an object recursively, by operating on objects.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
|||||||||||
arg1_value |
number
|
The value to modify ranges by. |
|||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) modifyValue(arg0_object, arg1_key, arg2_number, arg3_delete_negativeopt) → {number}
Modifies a given value in an object by a numeric value.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
arg0_object |
Object
|
|||
arg1_key |
string
|
|||
arg2_number |
number
|
string
|
|||
arg3_delete_negative |
boolean
|
<optional> |
false |
Whether to delete negative values. |
Returns:
- Type:
-
number
(static) multiply(arg0_object, arg1_value) → {Object}
Multiplies an object by a value, recursively.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
arg1_value |
number
|
The value to multiply each variable by. |
Returns:
- Type:
-
Object
(static) multiplyObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}
Multiplies an object recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The 1st object to pass. |
|||||||||||
arg1_object |
Object
|
The 2nd object to pass. |
|||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) operate(arg0_object, arg1_equation, arg2_optionsopt) → {Object}
Performs an operation on a single object, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
|||||||||||||||||||||
arg1_equation |
string
|
The string literal to use as an equation ('n' = current value). |
|||||||||||||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) operateObjects(arg0_object, arg1_object, arg2_equation, arg3_optionsopt) → {Object}
Performs an operation on two objects together, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The 1st object to pass. |
|||||||||||||||||||||
arg1_object |
Object
|
The 2nd object to pass. |
|||||||||||||||||||||
arg2_equation |
string
|
The string literal ('i' = 1st obj, 'x' = 2nd obj). |
|||||||||||||||||||||
arg3_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) removeZeroes(arg0_object) → {Object}
Removes zero values from an object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) serialise(arg0_object) → {Object}
Serialises a given object into a compatible object for hydration (i.e. browser-side).
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Array
|
Object
|
Returns:
- Type:
-
Object
(static) setValue(arg0_object, arg1_variable_string, arg2_value) → {any}
Sets a given value with a root object and variable string.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
|
arg1_variable_string |
string
|
|
arg2_value |
any
|
Returns:
- Type:
-
any
(static) sort(arg0_object, arg1_optionsopt)
Sorts an object.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||
arg1_options |
Object
|
<optional> |
|
(static) sortKeys(arg0_object, arg1_optionsopt) → {Object}
Sorts an object by their key's numeric values.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) sortYearValues(arg0_object) → {Object}
Sorts values chronologically by their year (key) per object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) standardiseFraction(arg0_object) → {Object}
Standardises the object to maximum = 1, adjusting all other values proportionally.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
Returns:
- Type:
-
Object
(static) standardisePercentage(arg0_object, arg1_totalopt, arg2_roundopt) → {Object}
Standardises the object to a given total.
- Source:
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
arg0_object |
Object
|
The object to pass. |
||
arg1_total |
number
|
<optional> |
1 |
The total figure to adjust the object to. |
arg2_round |
boolean
|
<optional> |
false |
Whether to force rounding. |
Returns:
- Type:
-
Object
(static) strictRemoveDuplicates(arg0_object) → {Object}
Removes values with duplicate values in an object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Object
(static) subtract(arg0_object, arg1_value) → {Object}
Subtracts a value from an object, recursively.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
The object to pass. |
arg1_value |
number
|
The value to subtract. |
Returns:
- Type:
-
Object
(static) subtractObjects(arg0_object, arg1_object, arg2_optionsopt) → {Object}
Subtracts one object from another, recursively.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object
|
The 1st object. |
|||||||||||
arg1_object |
Object
|
The 2nd object. |
|||||||||||
arg2_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) toArray(arg0_object) → {Array.<any>}
Casts an object to array.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_object |
Object
|
Returns:
- Type:
-
Array.<any>
(static) trimValue(arg0_object, arg1_optionsopt)
Trims a specific value from the start and/or end of an object map.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_object |
Object.<number>
|
||||||||||||||||||||||
arg1_options |
Object
|
<optional> |
|