Static methods

staticapplyOperation(data:JSONData, operation:JSONPatchOperation):JSONData

For the given JSON data, apply a single JSONPatch operation.

Parameters:

data

A JSON data object. You can pass Dynamic or Array<Dynamic> here.

patch

A JSONPatch operation to perform.

Returns:

The resulting JSON data.

See also:

staticapplyPatch(data:JSONData, patch:Array<JSONPatchOperation>):JSONData

For the given JSON data, apply all the provided JSONPatch operations.

Parameters:

data

A JSON data object. You can pass Dynamic or Array<Dynamic> here.

patch

An array of JSONPatch operations to perform.

Returns:

The resulting JSON data.

Throws:

error

If any of the operations fail or any of the tests return false. Your application should catch these errors, log them for users to fix, and return the unmodified original data.

See also:

staticapplyPatches(data:JSONData, patchBatch:Array<Dynamic>):JSONData

For the given JSON data, apply all the provided JSONPatches.

Parameters:

data

A JSON data object. You can pass Dynamic or Array<Dynamic> here.

patchBatch

Either a JSON Patch (as an array of operations) or an array of JSON Patches (i.e. an array of arrays of operations) If multiple patches are provided, each will apply to the data in order. In the event of a failed patch, the data will not be modified and the next patch will be evaluated.

Returns:

The resulting JSON data.