Class: Refinement

Refinement

new Refinement(cursor, path)

Represents a refinement of a given cursor.
Parameters:
Name Type Argument Description
cursor Cursor The underlying cursor.
path String | Number <repeatable>
The path of this refinement.

Members

value

The underlying value for this refinement.

Methods

equals(other) → {Boolean}

Compares this refinement to another and returns whether the two are equal.
Parameters:
Name Type Description
other Refinement The other refinement.
Returns:
Type
Boolean

modifyValue(cb)

Modify the underlying value of this refinement via a callback.
Parameters:
Name Type Description
cb modifyCb The callback used to modify. Will only be called once per invocation of modifyValue.

refine(path) → {Refinement}

Return another Refinement instance, with a path starting from this refinement.
Parameters:
Name Type Argument Description
path String | Number <repeatable>
The path to refine.
Returns:
Type
Refinement

setValue(newValue)

Set the underlying value of this refinement.
Parameters:
Name Type Description
newValue * The new value to set.