Skip to content

pantoken-root / packages/core/src / decodeIconSvg

Funktion: decodeIconSvg() ​

decodeIconSvg(value): string

Beta

Dekoder et ikon-tokens url('data:…')-værdi tilbage til inline SVG.

Parametre ​

value ​

string

Returnerer ​

string

Eksempel ​

ts
import { decodeIconSvg } from "@pantoken/core";

const svg = "<svg viewBox='0 0 24 24'><path d='M1 1'/></svg>";
const value = `url('data:image/svg+xml;utf8,${encodeURIComponent(svg)}')`;
decodeIconSvg(value); // → "<svg viewBox='0 0 24 24'><path d='M1 1'/></svg>"