MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / jsonPatch

Function jsonPatch

source/core/StarJsonPatch.cpp:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace Star {
6
7Json jsonPatch(Json const& base, JsonArray const& patch) {
8 auto res = base;
9 try {
10 for (auto const& operation : patch) {
11 res = JsonPatching::applyOperation(res, operation);
12 }
13 return res;
14 } catch (JsonException const& e) {
15 throw JsonPatchException(strf("Could not apply patch to base. {}", e.what()), false);
16 }
17}
18
19
20// Returns 0 if not found, index + 1 if found.

Callers 1

TESTFunction · 0.85

Calls 3

applyOperationFunction · 0.85
strfFunction · 0.85
whatMethod · 0.45

Tested by 1

TESTFunction · 0.68