fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
1 lines • 892 B
Source Map (JSON)
{"version":3,"file":"parseStyleString.min.mjs","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"],"names":["parseStyleString","style","oStyle","replace","split","forEach","chunk","attr","value","trim","toLowerCase"],"mappings":"AAMO,SAASA,EACdC,EACAC,GAEAD,EACGE,QAAQ,QAAS,IACjBC,MAAM,KACNC,SAASC,IACR,IAAKA,EAAO,OACZ,MAAOC,EAAMC,GAASF,EAAMF,MAAM,KAClCF,EAAOK,EAAKE,OAAOC,eAAiBF,EAAMC,MAAM,GAEtD"}