Methods
-
ancestors(first, second) → {Array}
-
Finds the common ancestor path between two states.
Parameters:
Name Type Description first
Object The first state.
second
Object The second state.
Returns:
Returns an array of state names in descending order, not including the root.
- Type
- Array
-
arraySearch(array, value) → {Number}
-
IE8-safe wrapper for
Array.prototype.indexOf()
.Parameters:
Name Type Description array
Array A JavaScript array.
value
* A value to search the array for.
Returns:
Returns the array index value of
value
, or-1
if not present.- Type
- Number
-
equalForKeys(a, b, keys) → {Boolean}
-
Performs a non-strict comparison of the subset of two objects, defined by a list of keys.
Parameters:
Name Type Description a
Object The first object.
b
Object The second object.
keys
Array The list of keys within each object to compare. If the list is empty or not specified, it defaults to the list of keys in
a
.Returns:
Returns
true
if the keys match, otherwisefalse
.- Type
- Boolean
-
filterByKeys(keys, values) → {Boolean}
-
Returns the subset of an object, based on a list of keys.
Parameters:
Name Type Description keys
Array values
Object Returns:
Returns a subset of
values
.- Type
- Boolean
-
inheritParams(currentParams, newParams, $current, $to)
-
Merges a set of parameters with all parameters inherited between the common parents of the current state and a given destination state.
Parameters:
Name Type Description currentParams
Object The value of the current state parameters ($stateParams).
newParams
Object The set of parameters which will be composited with inherited params.
$current
Object Internal definition of object representing the current state.
$to
Object Internal definition of object representing state to transition to.
-
keys(object) → {Array}
-
IE8-safe wrapper for
Object.keys()
.Parameters:
Name Type Description object
Object A JavaScript object.
Returns:
Returns the keys of the object as an array.
- Type
- Array
-
normalize(keys, values) → {Object}
-
Normalizes a set of values to string or
null
, filtering them by a list of keys.Parameters:
Name Type Description keys
Array The list of keys to normalize/return.
values
Object An object hash of values to normalize.
Returns:
Returns an object hash of normalized string values.
- Type
- Object