Skip to content

pantoken / packages/utils/src / unknownReferences

Függvény: unknownReferences()

unknownReferences(text, ir): string[]

Béta

Sodródás ellenőrzés: --instui-* nevek text-ban, amelyeket az IR nem határoz meg (rendezve; üres azt jelenti, hogy nincsen sodródás). Olyan kimenetek használatához, amelyek referencia máshol definiált tokenek — pl. a docosaurus/vitepress brigádok, amelyek var(--instui-*) céljai valódi tokenek kell, hogy legyenek.

Paraméterek

text

string

A generált kimenet.

ir

readonly Token[]

A forrás token IR.

Visszatérés

string[]

Az ismeretlen token nevek.

Példa

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)