mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
293 B
TypeScript
11 lines
293 B
TypeScript
import * as jsonPatch from "json8-patch";
|
|
|
|
const doc1 = { foo: "bar" };
|
|
const doc2 = { bar: 42 };
|
|
|
|
const patch = jsonPatch.diff(doc1, doc2);
|
|
const { doc, revert } = jsonPatch.apply(doc1, patch, { reversible: true });
|
|
|
|
// $ExpectType ApplyResult
|
|
const reverted = jsonPatch.revert(doc, revert);
|