MCPcopy Create free account
hub / github.com/triggerdotdev/jsonhero-web / calculateLongestMatch

Function calculateLongestMatch

app/utilities/search.ts:212–220  ·  view source on GitHub ↗
(componentSlices: ComponentSlice[])

Source from the content-addressed store, hash-verified

210 };
211
212 const calculateLongestMatch = (componentSlices: ComponentSlice[]): number => {
213 return componentSlices.reduce(
214 (longestMatch, slice) =>
215 slice.slice.isMatch
216 ? Math.max(longestMatch, slice.slice.slice.length)
217 : longestMatch,
218 0
219 );
220 };
221
222 const addEllipsisToSlices = (
223 slices: PathSlice[],

Callers 1

getComponentSlicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected