mirror of
https://github.com/nodejs/node.git
synced 2025-05-13 07:34:30 +00:00

PR-URL: https://github.com/nodejs/node/pull/38475 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
20 lines
667 B
TypeScript
20 lines
667 B
TypeScript
// Definitions by: Cameron Hunter <https://github.com/cameronhunter>
|
|
// Modified by: Angus Croll <https://github.com/angus-c>
|
|
type Operation = "add" | "replace" | "remove";
|
|
|
|
type JSONPatchPathConverter<OUTPUT> = (
|
|
arrayPath: Array<string | number>
|
|
) => OUTPUT;
|
|
|
|
export function diff(
|
|
a: object | Array<any>,
|
|
b: object | Array<any>,
|
|
): Array<{ op: Operation; path: Array<string | number>; value: any }>;
|
|
|
|
export function diff<PATH>(
|
|
a: object | Array<any>,
|
|
b: object | Array<any>,
|
|
jsonPatchPathConverter: JSONPatchPathConverter<PATH>
|
|
): Array<{ op: Operation; path: PATH; value: any }>;
|
|
|
|
export const jsonPatchPathConverter: JSONPatchPathConverter<string>; |