@graffy/fill 0.16.1 → 0.16.2

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 +6 -7
  2. package/index.mjs +4 -3
  3. package/package.json +3 -3
package/index.cjs CHANGED
@@ -2,12 +2,11 @@
2
2
  const common = require("@graffy/common");
3
3
  const stream = require("@graffy/stream");
4
4
  const debug = require("debug");
5
- const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
6
- const debug__default = /* @__PURE__ */ _interopDefaultLegacy(debug);
7
- const log$1 = debug__default.default("graffy:fill:subscribe");
5
+ const log$1 = debug("graffy:fill:subscribe");
8
6
  function subscribe(store, originalQuery, { raw }) {
9
7
  const empty = () => common.finalize([], originalQuery, 0);
10
- let push, end;
8
+ let push;
9
+ let end;
11
10
  let upstream;
12
11
  let query = [];
13
12
  let data = empty();
@@ -90,7 +89,7 @@ function subscribe(store, originalQuery, { raw }) {
90
89
  if (unknown)
91
90
  return resubscribe(unknown);
92
91
  if (!raw) {
93
- if (!isChange || sieved && sieved.length)
92
+ if (!isChange || (sieved == null ? void 0 : sieved.length))
94
93
  push(data);
95
94
  } else if (payload.length) {
96
95
  push(payload);
@@ -107,7 +106,7 @@ function subscribe(store, originalQuery, { raw }) {
107
106
  upstream.return();
108
107
  }
109
108
  }
110
- const log = debug__default.default("graffy:fill");
109
+ const log = debug("graffy:fill");
111
110
  const MAX_RECURSIONS = 10;
112
111
  function fill(_) {
113
112
  return (store) => {
@@ -115,7 +114,7 @@ function fill(_) {
115
114
  let value = await next(query);
116
115
  if (options.skipFill)
117
116
  return value;
118
- if (!value || !value.length) {
117
+ if (!(value == null ? void 0 : value.length)) {
119
118
  log("No progress", query);
120
119
  throw Error("fill.no_progress");
121
120
  }
package/index.mjs CHANGED
@@ -4,7 +4,8 @@ import debug from "debug";
4
4
  const log$1 = debug("graffy:fill:subscribe");
5
5
  function subscribe(store, originalQuery, { raw }) {
6
6
  const empty = () => finalize([], originalQuery, 0);
7
- let push, end;
7
+ let push;
8
+ let end;
8
9
  let upstream;
9
10
  let query = [];
10
11
  let data = empty();
@@ -87,7 +88,7 @@ function subscribe(store, originalQuery, { raw }) {
87
88
  if (unknown)
88
89
  return resubscribe(unknown);
89
90
  if (!raw) {
90
- if (!isChange || sieved && sieved.length)
91
+ if (!isChange || (sieved == null ? void 0 : sieved.length))
91
92
  push(data);
92
93
  } else if (payload.length) {
93
94
  push(payload);
@@ -112,7 +113,7 @@ function fill(_) {
112
113
  let value = await next(query);
113
114
  if (options.skipFill)
114
115
  return value;
115
- if (!value || !value.length) {
116
+ if (!(value == null ? void 0 : value.length)) {
116
117
  log("No progress", query);
117
118
  throw Error("fill.no_progress");
118
119
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graffy/fill",
3
3
  "description": "Graffy module for fulfilling queries using multiple backends, traversing links and turning subscriptions into live queries.",
4
4
  "author": "aravind (https://github.com/aravindet)",
5
- "version": "0.16.1",
5
+ "version": "0.16.2",
6
6
  "main": "./index.cjs",
7
7
  "exports": {
8
8
  "import": "./index.mjs",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
- "@graffy/common": "0.16.1",
19
+ "@graffy/common": "0.16.2",
20
20
  "debug": "^4.3.3",
21
- "@graffy/stream": "0.16.1"
21
+ "@graffy/stream": "0.16.2"
22
22
  }
23
23
  }