Skip to content

pantoken / packages/core/src / decodeIconSvg

Funktio: decodeIconSvg()

decodeIconSvg(value): string

Beta

Dekoodaa ikonitokenin url('data:…')-arvo takaisin inline-SVG:ksi.

Parametrit

value

string

Palauttaa

string

Esimerkki

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>"