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

Function calculateWeight

app/utilities/search.ts:192–200  ·  view source on GitHub ↗
(pathSlices: PathSlice[])

Source from the content-addressed store, hash-verified

190 maxWeight: number
191): Array<PathSlice> {
192 const calculateWeight = (pathSlices: PathSlice[]): number => {
193 let weight = 0;
194
195 for (const slice of pathSlices) {
196 weight += calculateSliceWeight(slice);
197 }
198
199 return weight;
200 };
201
202 const calculateSliceWeight = (slice: PathSlice): number => {
203 if (slice.type === "component") {

Callers 1

getComponentSlicesFunction · 0.85

Calls 1

calculateSliceWeightFunction · 0.85

Tested by

no test coverage detected