MCPcopy Index your code
hub / github.com/witheve/Eve / join

Function join

src/runtime/join.ts:866–888  ·  view source on GitHub ↗
(multiIndex: MultiIndex, providers : ProposalProvider[], vars : Variable[], prefix: any[] = [], options: JoinOptions = {})

Source from the content-addressed store, hash-verified

864// to determine how may rounds of generic join we need to do. Since we solve
865// for one variable each round, it's the number of vars in the query.
866export function join(multiIndex: MultiIndex, providers : ProposalProvider[], vars : Variable[], prefix: any[] = [], options: JoinOptions = {}) {
867 let rows = options.rows || [];
868 let {presolved, accepted} = preJoinAccept(multiIndex, providers, vars, prefix);
869 if(!accepted) return rows;
870 let rounds = 0;
871 for(let variable of vars) {
872 if(variable !== undefined) rounds++;
873 }
874 rounds = rounds - presolved;
875 if(presolved > 0 && rounds === 0) {
876 rows.push(prefix.slice());
877 } else if(rounds === 0) {
878 for(let provider of providers) {
879 if(!provider.accept(multiIndex, prefix, null, true)) {
880 return rows;
881 }
882 }
883 rows.push(prefix.slice());
884 } else {
885 joinRound(multiIndex, providers, prefix, rounds, rows, options);
886 }
887 return rows;
888}
889
890
891

Callers 1

executeMethod · 0.90

Calls 3

preJoinAcceptFunction · 0.85
joinRoundFunction · 0.85
acceptMethod · 0.65

Tested by

no test coverage detected