🚿 split svg creator file

This commit is contained in:
platane
2020-11-01 14:06:17 +01:00
parent 686f61d725
commit bb3d2bce11
5 changed files with 254 additions and 214 deletions

View File

@@ -0,0 +1,8 @@
export const h = (element: string, attributes: any) =>
`<${element} ${toAttribute(attributes)}/>`;
export const toAttribute = (o: any) =>
Object.entries(o)
.filter(([, value]) => value !== null)
.map(([name, value]) => `${name}="${value}"`)
.join(" ");