MCPcopy
hub / github.com/witheve/Eve / resolveProposal

Method resolveProposal

src/runtime/join.ts:291–316  ·  view source on GitHub ↗
(proposal, prefix)

Source from the content-addressed store, hash-verified

289 // all the actual values. If we didn't do this, we'd end up with strings instead of numbers
290 // for things like someone's age.
291 resolveProposal(proposal, prefix) {
292 let values = [];
293 let indexes = proposal.index;
294 if(indexes === undefined || indexes.length == 0) {
295 return values;
296 }
297 if(proposal.indexType !== "fullScan") {
298 let ix = 0;
299 for(let index of indexes) {
300 if(index === undefined) continue;
301 let keys = Object.keys(index);
302 let node = this.node;
303 for(let key of keys) {
304 let value = index[key];
305 values[ix] = value.value === undefined ? value : value.value;
306 ix++;
307 }
308 }
309 } else {
310 let resolved = this.resolve(prefix);
311 for(let index of indexes) {
312 this.fullScan(index, resolved, values);
313 }
314 }
315 return values;
316 }
317
318 // Given a prefix and a variable that we're solving for, we check if we agree with the
319 // current set of values. If this scan is completely resolved, we check for the presence

Callers

nothing calls this directly

Calls 2

resolveMethod · 0.95
fullScanMethod · 0.95

Tested by

no test coverage detected