@graffy/common 0.16.0 → 0.16.1

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.
Files changed (3) hide show
  1. package/index.cjs +2 -9
  2. package/index.mjs +2 -9
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -1495,15 +1495,8 @@ function encode(value, { version, isGraph } = {}) {
1495
1495
  const links = [];
1496
1496
  function pushLink($ref, $ver, props2, $val, $chi) {
1497
1497
  const [range, _] = splitRef($ref);
1498
- let children = !isEmpty(props2) ? makeNode2(
1499
- range ? [{ $key: range, ...props2 }] : props2,
1500
- void 0,
1501
- $ver
1502
- ).children : isDef($chi) ? makeNode2(
1503
- range ? [{ $key: range, $chi }] : $chi,
1504
- void 0,
1505
- $ver
1506
- ).children : isDef($val) ? $val : isGraph ? void 0 : 1;
1498
+ const node = !isEmpty(props2) ? makeNode2(range ? [{ $key: range, ...props2 }] : props2, void 0, $ver) : isDef($chi) ? makeNode2(range ? [{ $key: range, $chi }] : $chi, void 0, $ver) : null;
1499
+ const children = node ? node.children : isDef($val) ? $val : isGraph ? void 0 : 1;
1507
1500
  if (children) {
1508
1501
  links.push(wrap(children, encode$2($ref), $ver, !!range)[0]);
1509
1502
  }
package/index.mjs CHANGED
@@ -1490,15 +1490,8 @@ function encode(value, { version, isGraph } = {}) {
1490
1490
  const links = [];
1491
1491
  function pushLink($ref, $ver, props2, $val, $chi) {
1492
1492
  const [range, _] = splitRef($ref);
1493
- let children = !isEmpty(props2) ? makeNode2(
1494
- range ? [{ $key: range, ...props2 }] : props2,
1495
- void 0,
1496
- $ver
1497
- ).children : isDef($chi) ? makeNode2(
1498
- range ? [{ $key: range, $chi }] : $chi,
1499
- void 0,
1500
- $ver
1501
- ).children : isDef($val) ? $val : isGraph ? void 0 : 1;
1493
+ const node = !isEmpty(props2) ? makeNode2(range ? [{ $key: range, ...props2 }] : props2, void 0, $ver) : isDef($chi) ? makeNode2(range ? [{ $key: range, $chi }] : $chi, void 0, $ver) : null;
1494
+ const children = node ? node.children : isDef($val) ? $val : isGraph ? void 0 : 1;
1502
1495
  if (children) {
1503
1496
  links.push(wrap(children, encode$2($ref), $ver, !!range)[0]);
1504
1497
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/common",
3
3
  "description": "Common libraries that used by various Graffy modules.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.16.0",
5
+ "version": "0.16.1",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -18,6 +18,6 @@
18
18
  "dependencies": {
19
19
  "lodash": "^4.17.19",
20
20
  "merge-async-iterators": "^0.2.1",
21
- "@graffy/stream": "0.16.0"
21
+ "@graffy/stream": "0.16.1"
22
22
  }
23
23
  }