Skip to main content

Class: JSONPatch

Defined in: src/patch/patch.ts:330

Constructors​

new JSONPatch()​

new JSONPatch(ops?): JSONPatch

Defined in: src/patch/patch.ts:337

Parameters​

ops?​

OpObject[]

Returns​

JSONPatch

Methods​

[iterator]()​

[iterator](): Iterator<OpObject>

Defined in: src/patch/patch.ts:346

Returns​

Iterator<OpObject>

an iterator over ops in this patch.


add()​

add(path, value): this

Defined in: src/patch/patch.ts:358

Parameters​

path​

string | JSONPointer

value​

JSONValue

Returns​

this


apply()​

apply(value): JSONValue

Defined in: src/patch/patch.ts:440

Parameters​

value​

JSONValue

Returns​

JSONValue


build()​

protected build(ops): void

Defined in: src/patch/patch.ts:464

Parameters​

ops​

OpObject[]

Returns​

void


copy()​

copy(from, path): this

Defined in: src/patch/patch.ts:413

Parameters​

from​

string | JSONPointer

path​

string | JSONPointer

Returns​

this


ensurePointer()​

protected ensurePointer(p, op, index): JSONPointer

Defined in: src/patch/patch.ts:550

Parameters​

p​

string | JSONPointer

op​

string

index​

number

Returns​

JSONPointer


move()​

move(from, path): this

Defined in: src/patch/patch.ts:398

Parameters​

from​

string | JSONPointer

path​

string | JSONPointer

Returns​

this


opPointer()​

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

Defined in: src/patch/patch.ts:509

Parameters​

opObj​

OpObject

key​

keyof OpObject

op​

string

index​

number

Returns​

JSONPointer


opValue()​

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

Defined in: src/patch/patch.ts:537

Parameters​

opObj​

OpObject

key​

keyof OpObject

op​

string

index​

number

Returns​

JSONValue


remove()​

remove(path): this

Defined in: src/patch/patch.ts:369

Parameters​

path​

string | JSONPointer

Returns​

this


replace()​

replace(path, value): this

Defined in: src/patch/patch.ts:382

Parameters​

path​

string | JSONPointer

value​

JSONValue

Returns​

this


test()​

test(path, value): this

Defined in: src/patch/patch.ts:429

Parameters​

path​

string | JSONPointer

value​

JSONValue

Returns​

this


toArray()​

toArray(): OpObject[]

Defined in: src/patch/patch.ts:460

Returns​

OpObject[]