core.diffany | Medplum

diffAny() function

diffAny() returns an empty array if input and output are materially equal (i.e., would produce equivalent JSON); otherwise, it produces an array of patches that would transform input into output.

Here, "equal" means that the value at the target location and the value conveyed by "value" are of the same JSON type, and that they are considered equal by the following rules for that type:

Signature:

export declare function diffAny(input: any, output: any, ptr: Pointer, diff?: Diff): Operation[];

Parameters

Parameter Type Description
input any The original value.
output any The target value.
ptr Pointer JSON Pointer.
diff Diff (Optional) Diff function.

Returns:

Operation
The list of operations to get from the original to target value.