@mblaney/holster 1.0.34 → 1.0.35

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mblaney/holster",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "description": "Holster is a service that allows synchronising data between devices using Node, Deno, Bun or the browser.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/get.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {match, userPublicKey} from "./utils.js"
2
2
 
3
- const Get = (lex, graph) => {
3
+ const Get = (lex, graph, fast) => {
4
4
  if (!lex || typeof lex !== "object") {
5
5
  throw new TypeError("lex must be an object")
6
6
  }
@@ -47,6 +47,10 @@ const Get = (lex, graph) => {
47
47
  }
48
48
  }
49
49
  } else {
50
+ // For fast requests, return properties currently in the graph. Otherwise
51
+ // return undefined to ensure we get all matching properties from store.
52
+ if (!fast) return
53
+
50
54
  for (const key of Object.keys(graph[soul])) {
51
55
  // Always include userPublicKey for verification, regardless of filter
52
56
  if (key === userPublicKey || match(lex["."], key)) {
package/src/wire.js CHANGED
@@ -316,7 +316,7 @@ const Wire = opt => {
316
316
 
317
317
  if (!utils.obj.is(_opt)) _opt = {}
318
318
 
319
- const ack = Get(lex, graph)
319
+ const ack = Get(lex, graph, _opt.fast)
320
320
  const track = utils.text.random(9)
321
321
  const request = JSON.stringify({
322
322
  "#": dup.track(track),