Skip to content

pantoken / packages/utils/src / unknownReferences

फंक्शन: unknownReferences()

unknownReferences(text, ir): string[]

बीटा

ड्रिफ्ट जांच: --instui-* में text के नाम जो IR परिभाषित नहीं करता ((sorted; empty means no drift). आउटपुट्स के लिए उपयोग करें जो अन्यत्र परिभाषित टोकन का संदर्भ देते हैं — उदाहरण के लिए docusaurus/vitepress ब्रिज, जिनके var(--instui-*) लक्ष्यों को सभी वास्तविक टोकन होना चाहिए.

पैरामीटर

text

string

जनरेट किया गया आउटपुट।

ir

पढ़ने के लिए केवल Token[]

स्रोत टोकन IR।

वापसी

string[]

अज्ञात टोकन नाम।

उदाहरण

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)