Dynamic module json-pointer

Index

Functions

Functions

JSON_Pointer(object: Object): JSON_PointerWrap

Parameters

  • object: Object

Returns

JSON_PointerWrap

JSON_PointerWrap: 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

  • pointer: string

Returns

any

public has(pointer: string): boolean

Tests if an object has a value for a JSON pointer.

Parameters

  • pointer: string

Returns

boolean

public remove(pointer: string)

Removes an attribute of object referenced by pointer

Parameters

  • pointer: string

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

  • str: Array<string>

Returns

string

dict(object: Object): Object

Creates a dictionary object (pointer -> value).

Parameters

  • object: Object

Returns

Object

escape(str: string): string

Escapes a reference token.

Parameters

  • str: string

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

  • str: string

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

  • str: string

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