MCPcopy Create free account
hub / github.com/BuilderIO/framework-benchmarks / sortBy

Function sortBy

apps/components/src/components/utils/sort.ts:4–6  ·  view source on GitHub ↗
(key: any)

Source from the content-addressed store, hash-verified

2 * Usage: array.sort(sortBy('key'))
3 */
4export const sortBy = (key: any) => {
5 return (a: any, b: any) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0);
6};
7
8export const sortByNumeric = (key: any) => {
9 return (a: any, b: any) => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected