MCPcopy Create free account
hub / github.com/dailydotdev/apps / sortAlphabeticallyByProperty

Function sortAlphabeticallyByProperty

packages/shared/src/lib/func.ts:151–162  ·  view source on GitHub ↗
(property: keyof T)

Source from the content-addressed store, hash-verified

149
150export const sortAlphabeticallyByProperty =
151 <T>(property: keyof T) =>
152 (a: T, b: T): number => {
153 if (a[property] < b[property]) {
154 return -1;
155 }
156
157 if (a[property] > b[property]) {
158 return 1;
159 }
160
161 return 0;
162 };
163
164export enum UserAgent {
165 Chrome = 'Chrome',

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected