Members
- JGL
- JGL.ERROR_KEY
- JGL.LAST_RELATIVE_PATH
- JGL.REF_KEY
- JGL.del(graph, ...path)
- JGL.equals(src, other)
- JGL.errorToValue()
- JGL.explode(path)
- JGL.get(graph, ...path)
- JGL.isRange(obj)
- JGL.isRelative(from, to)
- JGL.pathValueIsError(pv)
- JGL.pathValueIsRef(pv)
- JGL.rangeContains(rng, idx)
- JGL.relative(from, to)
- JGL.resolve(pathValues)
- JGL.segmentContains(segment, key)
- JGL.segmentKeys(segment)
- JGL.set(graph, ...pathValue)
- JGL.traverse(graph, path, [populate])
- JGL.valueToError(value)
- type: JGL~Range
- type: JGL~PathSegment
- type: JGL~QueryKey
- type: JGL~QuerySegment
- type: JGL~Query
- type: JGL~Path
- type: JGL~PathValue
####JGL.ERROR_KEY
Default: '@error'
####JGL.LAST_RELATIVE_PATH
The last path that was generated by isRelative.
Useful for not having to re-compute the relative path after testing for
relativity.
Type: Query
####JGL.REF_KEY
Default: '@ref'
####JGL.del(graph, ...path)
Params
- graph
Object
- ...path
Path
Returns: Array.<PathValue>
####JGL.equals(src, other)
Compares two concrete paths to each other and returns true if they are the same
Params
Returns: Boolean
####JGL.errorToValue()
Params
Error
Returns: Object
####JGL.explode(path)
Expand a path into all possible variations
Params
- path
Query
Returns: Array.<Path>
Example
JGL.explode([[1, 2], [3, 4], 5]);
//=> [
// [1, 3, 5],
// [2, 3, 5],
// [1, 4, 5],
// [2, 4, 5]
// ]
####JGL.get(graph, ...path) Params
- graph
Object
- The source Object to pull values from - ...path
Query
- The Object paths to look up
Returns: Array.<PathValue>
####JGL.isRange(obj)
Params
- obj
Object
Returns: Boolean
####JGL.isRelative(from, to)
Params
Returns: Boolean
####JGL.pathValueIsError(pv)
Params
- pv
module:OPE~PathValue
Returns: Boolean
####JGL.pathValueIsRef(pv)
Params
- pv
PathValue
Returns: Boolean
####JGL.rangeContains(rng, idx)
Params
- rng
Range
- idx
Integer
Returns: Boolean
####JGL.relative(from, to)
Params
Returns: Query
####JGL.resolve(pathValues)
Params
- pathValues
Array.<PathValue>
Returns: Array.<PathValue>
####JGL.segmentContains(segment, key)
Params
- segment
QuerySegment
- key
QueryKey
|Array.<QueryKey>
Returns: Boolean
####JGL.segmentKeys(segment)
Params
- segment
QuerySegment
Returns: Array.<Integer,String>
####JGL.set(graph, ...pathValue)
Params
- graph
Object
- ...pathValue
PathValue
Returns: Array.<PathValue> - The array of PathValue's
that were set on the graph
####JGL.traverse(graph, path, [populate])
Params
- graph
Object
- The object to traverse - path
Path
- The path to follow - [populate=false]
Boolean
- Whether or not to create objects along the path on the object if they are not already defined
Returns: Array.<PathValue>
####JGL.valueToError(value)
Params
- value
Object
Returns: Error
####type: JGL~Range
An object that can be expanded into a series of indices
Scope: inner typedef of JGL
Type: Object
####type: JGL~PathSegment
The smallest part of a concrete path
Scope: inner typedef of JGL
Type: Integer
| String
####type: JGL~QueryKey
The smallest part of a complex query
Scope: inner typedef of JGL
Type: PathSegment | Range
####type: JGL~QuerySegment
A query segment can contain one or more query keys
Scope: inner typedef of JGL
Type: QueryKey | Array.<QueryKey>
####type: JGL~Query
A complex path query that can be expanded to get multiple concrete paths
Scope: inner typedef of JGL
Type: Array.<QuerySegment>
####type: JGL~Path
A concrete path. i.e: One that can not be expanded further.
Scope: inner typedef of JGL
Type: Array.<PathSegment>
####type: JGL~PathValue
Scope: inner typedef of JGL
Type: Object