JsonNode
Defined in: json/json-node.ts:68
A wrapper around unknown that tracks traversal path for lineage.
JsonNode enables typed navigation through JSON structures while maintaining provenance information. Each traversal operation returns a new JsonNode with an extended path, allowing you to trace exactly how you arrived at any value.
Extraction methods return JsonResult which is either a success with the value and its path, or a failure that will abort the pipeline.
Accessors
Section titled “Accessors”[TYPE_LABEL]
Section titled “[TYPE_LABEL]”Get Signature
Section titled “Get Signature”get [TYPE_LABEL]():
string
Defined in: json/json-node.ts:69
Returns
Section titled “Returns”string
Get Signature
Section titled “Get Signature”get path():
JsonPath
Defined in: json/json-node.ts:88
Returns the current path through the JSON structure.
Returns
Section titled “Returns”Methods
Section titled “Methods”asArray()
Section titled “asArray()”asArray():
JsonResult<readonlyJsonNode[]>
Defined in: json/json-node.ts:221
Extract as an array of JsonNodes.
Returns
Section titled “Returns”JsonResult<readonly JsonNode[]>
asBoolean()
Section titled “asBoolean()”asBoolean():
JsonResult<boolean>
Defined in: json/json-node.ts:193
Extract as a boolean.
Returns
Section titled “Returns”JsonResult<boolean>
asNull()
Section titled “asNull()”asNull():
JsonResult<null>
Defined in: json/json-node.ts:207
Extract as null.
Returns
Section titled “Returns”JsonResult<null>
asNumber()
Section titled “asNumber()”asNumber():
JsonResult<number>
Defined in: json/json-node.ts:179
Extract as a number.
Returns
Section titled “Returns”JsonResult<number>
asObject()
Section titled “asObject()”asObject():
JsonResult<Readonly<Record<string,JsonNode>>>
Defined in: json/json-node.ts:236
Extract as an object with JsonNode values.
Returns
Section titled “Returns”JsonResult<Readonly<Record<string, JsonNode>>>
asString()
Section titled “asString()”asString():
JsonResult<string>
Defined in: json/json-node.ts:165
Extract as a string.
Returns
Section titled “Returns”JsonResult<string>
at(
index):JsonResult<JsonNode>
Defined in: json/json-node.ts:135
Navigate to an element of an array. Returns a failure if the current value is not an array or index is out of bounds.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”JsonResult<JsonNode>
get(
key):JsonResult<JsonNode>
Defined in: json/json-node.ts:107
Navigate to a property of an object. Returns a failure if the current value is not an object or the key is missing.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”JsonResult<JsonNode>
has(
key):boolean
Defined in: json/json-node.ts:308
Check if the current value (when object) has a specific key.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
isArray()
Section titled “isArray()”isArray():
boolean
Defined in: json/json-node.ts:290
Check if the value is an array.
Returns
Section titled “Returns”boolean
isBoolean()
Section titled “isBoolean()”isBoolean():
boolean
Defined in: json/json-node.ts:276
Check if the value is a boolean.
Returns
Section titled “Returns”boolean
isNull()
Section titled “isNull()”isNull():
boolean
Defined in: json/json-node.ts:283
Check if the value is null.
Returns
Section titled “Returns”boolean
isNumber()
Section titled “isNumber()”isNumber():
boolean
Defined in: json/json-node.ts:269
Check if the value is a number.
Returns
Section titled “Returns”boolean
isObject()
Section titled “isObject()”isObject():
boolean
Defined in: json/json-node.ts:297
Check if the value is an object (not null, not array).
Returns
Section titled “Returns”boolean
isString()
Section titled “isString()”isString():
boolean
Defined in: json/json-node.ts:262
Check if the value is a string.
Returns
Section titled “Returns”boolean
unwrap()
Section titled “unwrap()”unwrap():
unknown
Defined in: json/json-node.ts:95
Returns the underlying raw value.
Returns
Section titled “Returns”unknown
from()
Section titled “from()”
staticfrom(value):JsonNode
Defined in: json/json-node.ts:81
Creates a JsonNode from a raw unknown.
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”JsonNode