Skip to content

pantoken / packages/utils/src / unknownReferences

Mahi: unknownReferences()

unknownReferences(text, ir): string[]

Beta

Tirohanga drift: --instui-* ingoa i roto i text kāore e tautuhia e te IR (i whakarārangihia; mēnā he wāhi wātea, kāore he drift). Whakamahia mō ngā putanga e tohutohu ana i ngā token i tautuhia i ētahi atu wāhi — hei tauira ngā āwhina docusaurus/vitepress, ā, me tino whai ko ngā whāinga var(--instui-*) he token tūturu.

Ngā Tawhā

text

string

Te putanga i hangaia.

ir

pānui-anake Token[]

Te IR puna o ngā token.

Whakahokia

string[]

Ngā ingoa token kāore anō kia mōhiotia.

Tauira

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)