🚿 split svg creator file
This commit is contained in:
8
packages/svg-creator/utils.ts
Normal file
8
packages/svg-creator/utils.ts
Normal 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(" ");
|
||||
Reference in New Issue
Block a user