Open Design Tokens
    Preparing search index...

    Function validateAliasToken

    • Validates the alias token at pointer in a document: alias syntax, target existence and kind, cycles, and type compatibility with expectedType (or the token's own or inherited type when omitted).

      Parameters

      • input: unknown
      • pointer: string
      • OptionalexpectedType:
            | "number"
            | "color"
            | "dimension"
            | "fontFamily"
            | "fontWeight"
            | "duration"
            | "cubicBezier"
            | "strokeStyle"
            | "border"
            | "transition"
            | "shadow"
            | "gradient"
            | "typography"

      Returns AliasCheck

      const check = validateAliasToken(tokens, '/semantic/primary');
      check.resolved; // true when the chain ends at a concrete token