Parameters
Returns
JSON_PointerWrap
public dict(): Object
Creates a dictionary object (pointer -> value).
Returns
Object
public get(pointer: string): any
Looks up a JSON pointer in an object.
Parameters
Returns
any
public has(pointer: string): boolean
Tests if an object has a value for a JSON pointer.
Parameters
Returns
boolean
public remove(pointer: string)
Removes an attribute of object referenced by pointer
Parameters
public set(pointer: string, value: any)
Set a value for a JSON pointer on object.
Parameters
-
pointer: string
-
value: any
public walk(iterator: (value: any, key: string) => void)
Just like: each(pointer.dict(obj), iterator);
Parameters
-
iterator: (value: any, key: string) => void
compile(str: Array<string>): string
Builds a json pointer from an array of reference tokens.
Parameters
Returns
string
dict(object: Object): Object
Creates a dictionary object (pointer -> value).
Parameters
Returns
Object
escape(str: string): string
Escapes a reference token.
Parameters
Returns
string
get(object: Object, pointer: string): any
Looks up a JSON pointer in an object.
Parameters
-
object: Object
-
pointer: string
Returns
any
has(object: Object, pointer: string): boolean
Tests if an object has a value for a JSON pointer.
Parameters
-
object: Object
-
pointer: string
Returns
boolean
parse(str: string): Array<string>
Converts a JSON pointer into an array of reference tokens.
Parameters
Returns
Array<string>
remove(object: Object, pointer: string)
Removes an attribute of object referenced by pointer
Parameters
-
object: Object
-
pointer: string
set(object: Object, pointer: string, value: any)
Set a value for a JSON pointer on object.
Parameters
-
object: Object
-
pointer: string
-
value: any
unescape(str: string): string
Unescape a reference token.
Parameters
Returns
string
walk(object: Object, iterator: (value: any, key: string) => void)
Just like: each(pointer.dict(obj), iterator);
Parameters
-
object: Object
-
iterator: (value: any, key: string) => void