Skip to content

pantoken / packages/utils/src / tokenNames

Hàm: tokenNames()

tokenNames(ir): Set<string>

Beta

Tập hợp các tên token mà một IR định nghĩa.

Tham số

ir

chỉ đọc Token[]

Trả về

Set<string>

Ví dụ

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

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