MCPcopy Create free account
hub / github.com/vercel/vercel / sortEndpoints

Method sortEndpoints

packages/cli/src/util/openapi/openapi-cache.ts:357–363  ·  view source on GitHub ↗

* Sort endpoints by path, then by method.

(endpoints: EndpointInfo[])

Source from the content-addressed store, hash-verified

355 * Sort endpoints by path, then by method.
356 */
357 private sortEndpoints(endpoints: EndpointInfo[]): EndpointInfo[] {
358 return endpoints.sort((a, b) => {
359 const pathCompare = a.path.localeCompare(b.path);
360 if (pathCompare !== 0) return pathCompare;
361 return a.method.localeCompare(b.method);
362 });
363 }
364
365 /**
366 * Extract all available endpoints from the loaded spec.

Callers 1

getEndpointsMethod · 0.95

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected