mini-jsx-test-pb 0.0.6 → 0.0.8

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.
@@ -33,21 +33,21 @@ function effect(fn) {
33
33
 
34
34
  // src/mount.ts
35
35
  function mountChild(parent, child) {
36
- if (child == null || child === false || child === true) {
36
+ if (child == null || child === true || child === false) return;
37
+ if (Array.isArray(child)) {
38
+ for (const c of child) mountChild(parent, c);
37
39
  return;
38
40
  }
39
- if (Array.isArray(child)) {
40
- for (const c of child) {
41
- mountChild(parent, c);
42
- }
41
+ if (child instanceof Node) {
42
+ parent.appendChild(child);
43
43
  return;
44
44
  }
45
45
  if (typeof child === "function") {
46
46
  const text = document.createTextNode("");
47
47
  parent.appendChild(text);
48
48
  effect(() => {
49
- const value = child();
50
- text.nodeValue = value == null ? "" : String(value);
49
+ const v = child();
50
+ text.nodeValue = v == null ? "" : String(v);
51
51
  });
52
52
  return;
53
53
  }
@@ -55,10 +55,6 @@ function mountChild(parent, child) {
55
55
  mountChild(parent, () => child.val);
56
56
  return;
57
57
  }
58
- if (child instanceof Node) {
59
- parent.appendChild(child);
60
- return;
61
- }
62
58
  parent.appendChild(document.createTextNode(String(child)));
63
59
  }
64
60
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  State,
3
3
  effect,
4
4
  h
5
- } from "./chunk-FLLMW3OM.js";
5
+ } from "./chunk-EKYJFDR5.js";
6
6
  export {
7
7
  State,
8
8
  effect,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  h
3
- } from "./chunk-FLLMW3OM.js";
3
+ } from "./chunk-EKYJFDR5.js";
4
4
  export {
5
5
  h as jsxDEV
6
6
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  h
3
- } from "./chunk-FLLMW3OM.js";
3
+ } from "./chunk-EKYJFDR5.js";
4
4
  export {
5
5
  h as jsx,
6
6
  h as jsxDEV,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mini-jsx-test-pb",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",