(patch: JsonPatch, oldValue: Schema.Json)
| 280 | * @since 4.0.0 |
| 281 | */ |
| 282 | export 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 | |
| 292 | function isJsonObject(value: unknown): value is Schema.JsonObject { |
| 293 | return typeof value === "object" && value !== null && !Array.isArray(value) |
no test coverage detected