node/deps/npm/node_modules/just-diff/index.d.ts
Ruy Adorno aa0e4eb27f
deps: upgrade npm to 7.14.0
PR-URL: https://github.com/nodejs/node/pull/38750
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-05-21 10:58:00 -04:00

20 lines
668 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>;