Class: JSONPatch
jsonpatch.JSONPatch
Constructors
constructor
• new JSONPatch(ops?
): JSONPatch
Parameters
Name | Type |
---|---|
ops? | OpObject [] |
Returns
Defined in
Properties
ops
• Private
ops: Op
[] = []
Defined in
Methods
[iterator]
▸ [iterator](): Iterator
<OpObject
, any
, undefined
>
Returns
Iterator
<OpObject
, any
, undefined
>
an iterator over ops in this patch.
Defined in
add
▸ add(path
, value
): this
Parameters
Name | Type |
---|---|
path | string | JSONPointer |
value | JSONValue |
Returns
this
Defined in
apply
▸ apply(value
): JSONValue
Parameters
Name | Type |
---|---|
value | JSONValue |
Returns
Defined in
build
▸ build(ops
): void
Parameters
Name | Type |
---|---|
ops | OpObject [] |
Returns
void
Defined in
copy
▸ copy(from
, path
): this
Parameters
Name | Type |
---|---|
from | string | JSONPointer |
path | string | JSONPointer |
Returns
this
Defined in
ensurePointer
▸ ensurePointer(p
, op
, index
): JSONPointer
Parameters
Name | Type |
---|---|
p | string | JSONPointer |
op | string |
index | number |
Returns
Defined in
move
▸ move(from
, path
): this
Parameters
Name | Type |
---|---|
from | string | JSONPointer |
path | string | JSONPointer |
Returns
this
Defined in
opPointer
▸ opPointer(opObj
, key
, op
, index
): JSONPointer
Parameters
Name | Type |
---|---|
opObj | OpObject |
key | keyof OpObject |
op | string |
index | number |
Returns
Defined in
opValue
▸ opValue(opObj
, key
, op
, index
): JSONValue
Parameters
Name | Type |
---|---|
opObj | OpObject |
key | keyof OpObject |
op | string |
index | number |
Returns
Defined in
remove
▸ remove(path
): this
Parameters
Name | Type |
---|---|
path | string | JSONPointer |
Returns
this
Defined in
replace
▸ replace(path
, value
): this
Parameters
Name | Type |
---|---|
path | string | JSONPointer |
value | JSONValue |
Returns
this
Defined in
test
▸ test(path
, value
): this
Parameters
Name | Type |
---|---|
path | string | JSONPointer |
value | JSONValue |
Returns
this
Defined in
toArray
▸ toArray(): OpObject
[]
Returns
OpObject
[]