Skip to content

pantoken / packages/core/src / decodeIconSvg

Fonction: decodeIconSvg()

decodeIconSvg(value): string

Bêta

Décoder la valeur url('data:…') d'un jeton d'icône pour la reconvertir en SVG intégré.

Paramètres

value

string

Retourne

string

Exemple

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