node/deps/npm/node_modules/just-diff/index.d.ts
Ruy Adorno c975dff3c0
deps: upgrade npm to 7.11.2
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>
2021-04-30 17:39:15 -04:00

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>;