MCPcopy Create free account
hub / github.com/microsoft/SandDance / compare

Function compare

packages/search-expression/src/compare.ts:43–53  ·  view source on GitHub ↗
(a: Search, b: Search)

Source from the content-addressed store, hash-verified

41}
42
43export function compare(a: Search, b: Search): boolean {
44 if (a == b) return true;
45 if (!a || !b) return false;
46 const arrs = [a, b].map(ensureSearchExpressionGroupArray);
47 const [arrA, arrB] = arrs;
48 if (arrA.length != arrB.length) return false;
49 for (let i = 0; i < arrA.length; i++) {
50 if (!compareGroup(arrA[i], arrB[i])) return false;
51 }
52 return true;
53}
54
55export function startsWith(whole: Search, part: Search): boolean {
56 if (!part) return true;

Callers

nothing calls this directly

Calls 1

compareGroupFunction · 0.70

Tested by

no test coverage detected