Skip to main content

Class: JSONPatch

jsonpatch.JSONPatch

Constructors

constructor

new JSONPatch(ops?): JSONPatch

Parameters

NameType
ops?OpObject[]

Returns

JSONPatch

Defined in

src/patch/patch.ts:361

Properties

ops

Private ops: Op[] = []

Defined in

src/patch/patch.ts:355

Methods

[iterator]

[iterator](): Iterator<OpObject, any, undefined>

Returns

Iterator<OpObject, any, undefined>

an iterator over ops in this patch.

Defined in

src/patch/patch.ts:370


add

add(path, value): this

Parameters

NameType
pathstring | JSONPointer
valueJSONValue

Returns

this

Defined in

src/patch/patch.ts:382


apply

apply(value): JSONValue

Parameters

NameType
valueJSONValue

Returns

JSONValue

Defined in

src/patch/patch.ts:464


build

build(ops): void

Parameters

NameType
opsOpObject[]

Returns

void

Defined in

src/patch/patch.ts:488


copy

copy(from, path): this

Parameters

NameType
fromstring | JSONPointer
pathstring | JSONPointer

Returns

this

Defined in

src/patch/patch.ts:437


ensurePointer

ensurePointer(p, op, index): JSONPointer

Parameters

NameType
pstring | JSONPointer
opstring
indexnumber

Returns

JSONPointer

Defined in

src/patch/patch.ts:574


move

move(from, path): this

Parameters

NameType
fromstring | JSONPointer
pathstring | JSONPointer

Returns

this

Defined in

src/patch/patch.ts:422


opPointer

opPointer(opObj, key, op, index): JSONPointer

Parameters

NameType
opObjOpObject
keykeyof OpObject
opstring
indexnumber

Returns

JSONPointer

Defined in

src/patch/patch.ts:533


opValue

opValue(opObj, key, op, index): JSONValue

Parameters

NameType
opObjOpObject
keykeyof OpObject
opstring
indexnumber

Returns

JSONValue

Defined in

src/patch/patch.ts:561


remove

remove(path): this

Parameters

NameType
pathstring | JSONPointer

Returns

this

Defined in

src/patch/patch.ts:393


replace

replace(path, value): this

Parameters

NameType
pathstring | JSONPointer
valueJSONValue

Returns

this

Defined in

src/patch/patch.ts:406


test

test(path, value): this

Parameters

NameType
pathstring | JSONPointer
valueJSONValue

Returns

this

Defined in

src/patch/patch.ts:453


toArray

toArray(): OpObject[]

Returns

OpObject[]

Defined in

src/patch/patch.ts:484