UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

1 lines 826 B
{"version":3,"file":"parseStyleString.min.mjs","names":[],"sources":["../../../src/parser/parseStyleString.ts"],"sourcesContent":["/**\n * Takes a style string and parses it in one that has only defined values\n * and lowercases properties\n * @param style\n * @param oStyle\n */\nexport function parseStyleString(\n style: string,\n oStyle: Record<string, any>,\n): void {\n style\n .replace(/;\\s*$/, '')\n .split(';')\n .forEach((chunk) => {\n if (!chunk) return;\n const [attr, value] = chunk.split(':');\n oStyle[attr.trim().toLowerCase()] = value.trim();\n });\n}\n"],"mappings":"AAMA,SAAgB,EACd,EACA,EAAA,CAEA,EACG,QAAQ,QAAS,GAAA,CACjB,MAAM,IAAA,CACN,QAAS,GAAA,CACR,GAAA,CAAK,EAAO,OACZ,GAAA,CAAO,EAAM,GAAS,EAAM,MAAM,IAAA,CAClC,EAAO,EAAK,MAAA,CAAO,aAAA,EAAiB,EAAM,MAAA,EAAA,CAAA,OAAA,KAAA"}