DiffUtility
Index
Constructors
constructor
Returns DiffUtility
Methods
staticdiffArray
Generate a deep diff of an array of basic types from the previous node vs the latest node.
Parameters
a: UnknownNode
previous node.
b: UnknownNode
latest node.
field: string
string representing the field parent uses to reference the array.
Returns Diff<UnknownNode, unknown>[]
staticdiffArrayOfObjects
Generate a deep diff of an array of objects from the previous node vs the latest node.
Parameters
a: UnknownNode
previous node.
b: UnknownNode
latest node.
field: string
string representing the field parent uses to reference the array.
compare: (object1: unknown, object2: unknown) => boolean
function to check if two objects are equal.
Returns Diff<UnknownNode, unknown>[]
staticdiffMap
Generate a deep diff of a map of basic types from the previous node vs the latest node.
Parameters
a: UnknownNode
previous node.
b: UnknownNode
latest node.
field: string
string representing the field parent uses to reference the map.
Returns Diff<UnknownNode, unknown>[]
staticdiffNodes
Generate a deep diff of an array of previous node vs latest node. The diff is generated recursively, i.e. all children of the node are included in the diff.
Parameters
a: UnknownNode[]
array of previous nodes.
b: UnknownNode[]
array of latest nodes.
field: string
string representing the unique identifier of the node.
Returns Promise<Diff<UnknownNode, unknown>[]>
staticdiffObject
Generate a deep diff of an object from the previous node vs the latest node.
Parameters
a: UnknownNode
previous node.
b: UnknownNode
latest node.
field: string
string representing the field parent uses to reference the object.
Returns Diff<UnknownNode, unknown>[]
staticisObjectDeepEquals
Parameters
x: unknown
y: unknown
excludePaths: string[] = []
currentPath: string[] = []
Returns boolean
Functions/Diff