Skip to content

pantoken / packages/utils/src / unknownReferences

Funkcja: unknownReferences()

unknownReferences(text, ir): string[]

Beta

Kontrola dryfu: --instui-* nazwy w text, których IR nie definiuje (posortowane; puste oznacza brak dryfu). Używane dla wyników, które odwołują się do tokenów zdefiniowanych gdzie indziej — np. mosty docusaurus/vitepress, których cele var(--instui-*) muszą być prawdziwymi tokenami.

Parametry

text

string

Wygenerowane wyjście.

ir

tylko do odczytu Token[]

Źródłowy IR tokenów.

Zwraca

string[]

Nieznane nazwy tokenów.

Przykład

ts
import { unknownReferences } from "@pantoken/utils";
import type { Token } from "@pantoken/model";

const ir: Token[] = [
  { name: "--instui-leaf", syntax: "<color>", inherits: true, value: "#0374B5" },
];

unknownReferences("--x: var(--instui-leaf); --y: var(--instui-gone);", ir);
// → ["--instui-gone"]
unknownReferences("--x: var(--instui-leaf);", ir); // → []  (no drift)