SEMQ TypeScript API
    Preparing search index...

    Class Diff

    The result of reference.diff(candidate). Keeps the rows it needs alive until Diff.dispose or the finalizer runs, even after the caller disposes its Encodings.

    Index
    • get added(): string[] | bigint[]

      Ids only in the candidate, canonical order.

      Returns string[] | bigint[]

    • get candidateId(): Uint8Array

      stateId of the candidate (32 bytes).

      Returns Uint8Array

    • get changed(): [string | bigint, number][]

      [id, hamming] for ids on both sides with different rows, canonical order; hamming counts units whose symbol differs.

      Returns [string | bigint, number][]

    • get idKind(): "u64" | "utf8"

      Returns "u64" | "utf8"

    • get manifestChanges(): Record<string, [string | null, string | null]>

      key -> [before | null, after | null] for keys that differ or exist on one side, as a plain object whose every key is an own property (a key named __proto__ included).

      Returns Record<string, [string | null, string | null]>

    • get nUnchanged(): number

      Ids on both sides with identical rows.

      Returns number

    • get referenceId(): Uint8Array

      stateId of the reference (32 bytes).

      Returns Uint8Array

    • get removed(): string[] | bigint[]

      Ids only in the reference, canonical order.

      Returns string[] | bigint[]

    • The report schema: digests as lowercase hex, u64 ids as decimal strings, counts as numbers, no floats.

      Returns {
          added: string[];
          candidate_id: string;
          changed: [string, number][];
          config: Record<string, string | number>;
          id_kind: "u64" | "utf8";
          manifest_changes: Record<string, [string | null, string | null]>;
          n_unchanged: number;
          reference_id: string;
          removed: string[];
      }

    • The verdict of floor on this diff, with every check that failed.

      With no options, passed equals Diff.within. With perRow: true the verdict also fails when any changed row has a hamming above floor.maxHamming, and rows lists those ids. Incompatible for a floor of another config, id kind or reference, and for the per-row check on a floor without per-row data (from Floor.measure without perRow, or saved by SEMQ 1.0).

      Parameters

      Returns Verdict

    • One sentence, the same text in every binding: 1 of 3 rows changed: doc-3 (hamming 3). 0 added, 0 removed. Up to five changed ids are listed; changed manifest keys are named at the end.

      Returns string

    • [unit, symbolReference, symbolCandidate] for every unit of id that differs. Empty for an identical row; InvalidInput when id is absent from either side or of the wrong kind.

      Parameters

      • id: string | bigint

      Returns [number, number, number][]

    • True iff the candidate is within floor (exact integer arithmetic in the core). The floor must have been measured against this diff's config, id kind and reference; otherwise Incompatible.

      Parameters

      Returns boolean