@ktjs/mui-icon 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,6 +2,14 @@ import { applyAttr } from '@ktjs/core';
2
2
 
3
3
  function svg(...args) {
4
4
  const [a0, a1, a2] = args;
5
+ if (a0 instanceof SVGElement) {
6
+ const s = create();
7
+ s.appendChild(a0);
8
+ if (typeof a1 === 'string') {
9
+ s.setAttribute('title', a1);
10
+ }
11
+ return s;
12
+ }
5
13
  if (typeof a0 === 'object' && a0 !== null && a0.children) {
6
14
  return svg(a0.children, a1);
7
15
  }
@@ -34,14 +42,6 @@ function svg(...args) {
34
42
  }
35
43
  return s;
36
44
  }
37
- if (a0 instanceof SVGElement) {
38
- const s = create();
39
- s.appendChild(a0);
40
- if (typeof a1 === 'string') {
41
- s.setAttribute('title', a1);
42
- }
43
- return s;
44
- }
45
45
  console.warn('Invalid arguments for svg function:', args);
46
46
  return document.createElementNS('http://www.w3.org/2000/svg', 'svg');
47
47
  }