Skip to content

pantoken / packages/utils/src / unknownReferences

Fonksiyon: unknownReferences()

unknownReferences(text, ir): string[]

Beta

Sapma denetimi: --instui-* içinde, IR'nin tanımlamadığı text adları (sıralı; boşsa sapma yok demektir). Başka yerde tanımlanmış tokenlara başvuran çıktılar için kullanın — ör. docusaurus/vitepress köprüleri, bunların var(--instui-*) hedeflerinin tamamı gerçek tokenlar olmalıdır.

Parametreler

text

string

Oluşturulan çıktı.

ir

salt okunur Token[]

Kaynak token IR'si.

Döndürür

string[]

Bilinmeyen token adları.

Örnek

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)