hyper-dom-expressions 0.35.6 → 0.35.7

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.
@@ -7,6 +7,9 @@ const $ELEMENT = Symbol("hyper-element");
7
7
 
8
8
 
9
9
 
10
+
11
+
12
+
10
13
  // Inspired by https://github.com/hyperhype/hyperscript
11
14
  function createHyperScript(r) {
12
15
  function h() {
@@ -14,6 +17,8 @@ function createHyperScript(r) {
14
17
  e,
15
18
  multiExpression = false;
16
19
 
20
+ while (Array.isArray(args[0])) args = args[0];
21
+ if (args[0][$ELEMENT]) args.unshift(h.Fragment);
17
22
  typeof args[0] === "string" && detectMultiExpression(args);
18
23
  const ret = () => {
19
24
  while (args.length) item(args.shift());
@@ -117,6 +122,7 @@ function createHyperScript(r) {
117
122
  }
118
123
  }
119
124
 
125
+ h.Fragment = (props) => props.children;
120
126
  return h;
121
127
  }
122
128
 
@@ -11,6 +11,9 @@ const $ELEMENT = Symbol("hyper-element");
11
11
 
12
12
 
13
13
 
14
+
15
+
16
+
14
17
  // Inspired by https://github.com/hyperhype/hyperscript
15
18
  function createHyperScript(r) {
16
19
  function h() {
@@ -18,6 +21,8 @@ function createHyperScript(r) {
18
21
  e,
19
22
  multiExpression = false;
20
23
 
24
+ while (Array.isArray(args[0])) args = args[0];
25
+ if (args[0][$ELEMENT]) args.unshift(h.Fragment);
21
26
  typeof args[0] === "string" && detectMultiExpression(args);
22
27
  const ret = () => {
23
28
  while (args.length) item(args.shift());
@@ -121,6 +126,7 @@ function createHyperScript(r) {
121
126
  }
122
127
  }
123
128
 
129
+ h.Fragment = (props) => props.children;
124
130
  return h;
125
131
  }
126
132
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hyper-dom-expressions",
3
3
  "description": "A Fine-Grained Rendering Runtime API using HyperScript",
4
- "version": "0.35.6",
4
+ "version": "0.35.7",
5
5
  "author": "Ryan Carniato",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -19,7 +19,7 @@
19
19
  "prepare": "npm run build"
20
20
  },
21
21
  "devDependencies": {
22
- "dom-expressions": "^0.35.6"
22
+ "dom-expressions": "^0.35.7"
23
23
  },
24
- "gitHead": "0525efe1ea9d3e43336dea787de0b84e6d42ed72"
24
+ "gitHead": "90f80e89a618d693dfa4ab1fa86d9dc884d15172"
25
25
  }
package/types/index.d.ts CHANGED
@@ -12,6 +12,9 @@ declare type ExpandableNode = Node & {
12
12
  };
13
13
  export declare type HyperScript = {
14
14
  (...args: any[]): () => ExpandableNode | ExpandableNode[];
15
+ Fragment: (props: {
16
+ children: (() => ExpandableNode) | (() => ExpandableNode)[];
17
+ }) => ExpandableNode[];
15
18
  };
16
19
  export declare function createHyperScript(r: Runtime): HyperScript;
17
20
  export {};