UNPKG

@n1ru4l/json-patch-plus

Version:

This is a slimmed version of [jsondiffpatch](https://github.com/benjamine/jsondiffpatch). All the code is taken from the [jsondiffpatch](https://github.com/benjamine/jsondiffpatch) repository, slimmed down, slightly altered and converted to TypeScript.

25 lines (24 loc) 966 B
import type { Delta } from "./types"; declare type Input = unknown; export declare type ObjectHashFunction = (object: object, index?: number) => string; export declare type DiffOptions = { /** * A function for generating a identifier from an object in order to produce more performant list update patches. */ objectHash?: ObjectHashFunction; /** Whether you wanna force matching by array position. (Note: You do not wanna do this. Please specify a objectHash function :). */ matchByPosition?: boolean; /** * Whether the previous value should be included in the diff. * This can drastically increase the patch size and should only be used for debugging * or cases where you need to perform more advanced consistency checks. * * Default: `false` * */ includePreviousValue?: boolean; }; export declare function diff(input: { left: Input; right: Input; }, options?: DiffOptions): Delta; export {};