日本語
@eightkk/vue-weave / core / diffStructure
Function: diffStructure()
diffStructure<
T>(before,after,options):StructureDiff
Defined in: src/core/structureDiff.ts:135
Compare two versions of a flat or tree-shaped collection by key, for example two revisions of a bill of materials, a WBS or a product hierarchy. Returns the added and removed keys, the changed fields with their values in both versions, and, with parentKey, the items whose parent changed. Each version is checked on its own; a check that fails names the version, as in Duplicate item ID: a (before). Throws an Error for an invalid or duplicate key, an invalid or unknown parent key or a cycle, and a TypeError for inputs that are not arrays, invalid options or a fields function that returns no object. Resolve effective dates before the call: diff two resolved versions. The inputs are not changed, and the values in the result are the inputs' own.
Type Parameters
T
T
Parameters
before
readonly T[]
after
readonly T[]