Skip to content

pantoken-root / packages/core/src / dedupeByName

Fušla: dedupeByName() ​

dedupeByName(tokens): Token[]

Behta

Duplikahta tokenat nammas, válddat oažžo čalbmi (dasgo máŋga pluginat galggai vuođđudit).

Parametera ​

tokens ​

Token[]

Gullii / Gávdnat ​

Token[]

Example ​

ts
import { dedupeByName } from "@pantoken/core";
import type { Token } from "@pantoken/model";

const tokens: Token[] = [
  { name: "--instui-x", syntax: "<color>", inherits: true, value: "#fff" },
  { name: "--instui-x", syntax: "<color>", inherits: true, value: "#000" },
];
dedupeByName(tokens); // → one token, value "#000" (the later wins)