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

Function eavsToComparables

test/shared_functions.ts:25–42  ·  view source on GitHub ↗
(eavs, entities, index = {})

Source from the content-addressed store, hash-verified

23}
24
25export function eavsToComparables(eavs, entities, index = {}) {
26 let results = [];
27 for(let eav of eavs) {
28 let [e,a,v] = eav;
29 let cur = index[e];
30 if(!index[e]) {
31 cur = index[e] = {list: [], links: [], e};
32 results.push(cur);
33 }
34 if(entities[v]) {
35 cur.links.push([a, v]);
36 } else {
37 let avKey = `${a}, ${v}`;
38 cur.list.push(avKey);
39 }
40 }
41 return results;
42}
43
44// Tests if the elements of `as` are in `bs` by comparing keys in a list. In
45// the case of floating points, we want the comparison to be looser, to account

Callers 1

verifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected