@graffy/common
Advanced tools
Comparing version 0.14.7-alpha.6 to 0.14.7-alpha.7
@@ -18,5 +18,6 @@ "use strict"; | ||
mergeStreams: true, | ||
setVersion: true | ||
setVersion: true, | ||
getKnown: true | ||
}; | ||
exports.setVersion = exports.mergeStreams = exports.sieve = exports.slice = exports.merge = exports.add = void 0; | ||
exports.getKnown = exports.setVersion = exports.mergeStreams = exports.sieve = exports.slice = exports.merge = exports.add = void 0; | ||
@@ -47,2 +48,6 @@ var _add = _interopRequireDefault(require("./add")); | ||
var _getKnown = _interopRequireDefault(require("./getKnown")); | ||
exports.getKnown = _getKnown["default"]; | ||
var _step = require("./step"); | ||
@@ -49,0 +54,0 @@ |
@@ -97,2 +97,4 @@ "use strict"; | ||
function sliceNode(graph, query, result) { | ||
var _query$options; | ||
var key = query.key, | ||
@@ -142,2 +144,8 @@ version = query.version; | ||
result.addLinked((0, _path.wrap)(query.children, graph.path, version)); | ||
} else if ((0, _node2.isBranch)(graph) && ((_query$options = query.options) == null ? void 0 : _query$options.subtree)) { | ||
// This option allows a query to say "give me the subtree under this" | ||
// without knowing specifically what's available. If using this, the | ||
// value of "unknown" is no longer reliable. It is intended for use in | ||
// optimistic updates. | ||
result.addKnown(graph); | ||
} else if ((0, _node2.isBranch)(graph) || (0, _node2.isBranch)(query)) { | ||
@@ -144,0 +152,0 @@ // One side is a branch while the other is a leaf; throw error. |
@@ -5,3 +5,3 @@ { | ||
"author": "aravind (https://github.com/aravindet)", | ||
"version": "0.14.7-alpha.6", | ||
"version": "0.14.7-alpha.7", | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "source": "src/index.js", |
@@ -8,2 +8,3 @@ export { default as add } from './add'; | ||
export { default as setVersion } from './setVersion'; | ||
export { default as getKnown } from './getKnown'; | ||
export * from './step'; |
@@ -85,2 +85,8 @@ import { | ||
result.addLinked(wrap(query.children, graph.path, version)); | ||
} else if (isBranch(graph) && query.options?.subtree) { | ||
// This option allows a query to say "give me the subtree under this" | ||
// without knowing specifically what's available. If using this, the | ||
// value of "unknown" is no longer reliable. It is intended for use in | ||
// optimistic updates. | ||
result.addKnown(graph); | ||
} else if (isBranch(graph) || isBranch(query)) { | ||
@@ -87,0 +93,0 @@ // One side is a branch while the other is a leaf; throw error. |
126426
68
3131