Jsonpatch
No description available
Install / Use
/learn @EliteMasterEric/JsonpatchREADME
JSONPatch
A library for parsing and evaluating JSONPatch files on JSON data objects.
It deviates from the spec to add support for additional features, but seeks to otherwise be fully compatible with JSONPatch data that is compliant with RFC6902.
Additional features include:
- The ability to test that a key exists by omitting
valuefrom thetestoperation. - The ability to invert a test by providing
"inverse": truein thetestoperation. - The ability to provide a batch of JSONPatches to evaluate one at a time, gracefully skipping the patches containing a failed operation.
- The ability to use JSONPath for the path argument, instead of only supporting JSONPointer values.
Example
import json.patch.JSONPatch;
var patch = [
{"op": "add", "path": "/a/d", "value": "e"}
];
var data = {"a": {"b": "c"}}
// {"a": {"b": "c", "d": "e"}}
trace(JSONPatch.applyPatches(patch, data));
// JSONPath is also supported.
var patch = [
{"op": "replace", "path": "$..c", "value": 3}
];
var data = {"a": {"c": 11}, "b": {"c": 12}};
// {"a": {"c": 3 }, "b": { "c": 3 }}}
trace(JSONPatch.applyPatches(patch, data));
Licensing
JSONPatch is made available under an open source MIT License. You can read more at LICENSE.
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
