MCPcopy Create free account
hub / github.com/Effect-TS/effect / apply

Function apply

packages/effect/src/JsonPatch.ts:282–290  ·  view source on GitHub ↗
(patch: JsonPatch, oldValue: Schema.Json)

Source from the content-addressed store, hash-verified

280 * @since 4.0.0
281 */
282export function apply(patch: JsonPatch, oldValue: Schema.Json): Schema.Json {
283 let doc = oldValue
284
285 for (const op of patch) {
286 doc = applyOperation(doc, op)
287 }
288
289 return doc
290}
291
292function isJsonObject(value: unknown): value is Schema.JsonObject {
293 return typeof value === "object" && value !== null && !Array.isArray(value)

Callers 1

applyMiddlewareFunction · 0.50

Calls 1

applyOperationFunction · 0.85

Tested by

no test coverage detected