@graffy/common 0.16.15-alpha.2 → 0.16.15-alpha.4

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 +10 -1
  2. package/index.mjs +10 -1
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -1288,7 +1288,7 @@ function decorate(rootGraph, rootQuery) {
1288
1288
  graph = Array.isArray(plumGraph) ? plumGraph.slice(0) : { ...plumGraph };
1289
1289
  graph.$val = true;
1290
1290
  } else if (Array.isArray(plumGraph)) {
1291
- graph = decodeGraph(plumGraph);
1291
+ graph = deValNull(decodeGraph(plumGraph));
1292
1292
  } else {
1293
1293
  throw Error("decorate.unexpected_graph");
1294
1294
  }
@@ -1361,6 +1361,15 @@ function decorate(rootGraph, rootQuery) {
1361
1361
  const result = construct(rootGraph, rootQuery);
1362
1362
  return result;
1363
1363
  }
1364
+ function deValNull(graph) {
1365
+ if (typeof graph !== "object" || !graph)
1366
+ return graph;
1367
+ if ("$val" in graph && graph.$val !== true)
1368
+ return graph.$val;
1369
+ for (const prop in graph)
1370
+ graph[prop] = deValNull(graph[prop]);
1371
+ return graph;
1372
+ }
1364
1373
  function addPageMeta(graph, args) {
1365
1374
  if (args.$all) {
1366
1375
  Object.assign(graph, { $page: args, $prev: null, $next: null });
package/index.mjs CHANGED
@@ -1286,7 +1286,7 @@ function decorate(rootGraph, rootQuery) {
1286
1286
  graph = Array.isArray(plumGraph) ? plumGraph.slice(0) : { ...plumGraph };
1287
1287
  graph.$val = true;
1288
1288
  } else if (Array.isArray(plumGraph)) {
1289
- graph = decodeGraph(plumGraph);
1289
+ graph = deValNull(decodeGraph(plumGraph));
1290
1290
  } else {
1291
1291
  throw Error("decorate.unexpected_graph");
1292
1292
  }
@@ -1359,6 +1359,15 @@ function decorate(rootGraph, rootQuery) {
1359
1359
  const result = construct(rootGraph, rootQuery);
1360
1360
  return result;
1361
1361
  }
1362
+ function deValNull(graph) {
1363
+ if (typeof graph !== "object" || !graph)
1364
+ return graph;
1365
+ if ("$val" in graph && graph.$val !== true)
1366
+ return graph.$val;
1367
+ for (const prop in graph)
1368
+ graph[prop] = deValNull(graph[prop]);
1369
+ return graph;
1370
+ }
1362
1371
  function addPageMeta(graph, args) {
1363
1372
  if (args.$all) {
1364
1373
  Object.assign(graph, { $page: args, $prev: null, $next: null });
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.15-alpha.2",
5
+ "version": "0.16.15-alpha.4",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -19,6 +19,6 @@
19
19
  "lodash": "^4.17.19",
20
20
  "debug": "^4.3.3",
21
21
  "merge-async-iterators": "^0.2.1",
22
- "@graffy/stream": "0.16.15-alpha.2"
22
+ "@graffy/stream": "0.16.15-alpha.4"
23
23
  }
24
24
  }