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

Function startsWith

packages/search-expression/src/compare.ts:55–64  ·  view source on GitHub ↗
(whole: Search, part: Search)

Source from the content-addressed store, hash-verified

53}
54
55export function startsWith(whole: Search, part: Search): boolean {
56 if (!part) return true;
57 const arrs = [whole, part].map(ensureSearchExpressionGroupArray);
58 const [wholeArray, partArray] = arrs;
59 if (partArray.length > wholeArray.length) return false;
60 for (let i = 0; i < partArray.length; i++) {
61 if (!compareGroup(wholeArray[i], partArray[i])) return false;
62 }
63 return true;
64}

Callers

nothing calls this directly

Calls 1

compareGroupFunction · 0.70

Tested by

no test coverage detected