@ericwhitedev/lcsts
    Preparing search index...

    Class ComparisonUnitTokenAbstract

    Abstract base class for tokens used in longest-common-subsequence comparison.

    Subclass ComparisonUnitToken to define how individual tokens are matched. Two built-in implementations are provided: ComparisonUnitTokenString (exact string equality with bullet-character normalisation) and ComparisonUnitTokenRegex (regular-expression matching).

    Each token may carry an optional data payload that is preserved through comparison but does not affect matching.

    const a = new ComparisonUnitTokenString('hello');
    const b = new ComparisonUnitTokenString('hello');
    console.log(a.isMatch(b)); // true

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    data: unknown

    Optional user-defined payload attached to this token.

    Methods

    • Returns a short, unformatted string identifying this token.

      Returns string

      A concise string label.

    • Returns a formatted string representation of this token, indented by the specified number of spaces.

      Parameters

      • indent: number

        Number of leading spaces.

      Returns string

      A formatted, human-readable string.