diff --git a/src/array/alphabetical.ts b/src/array/alphabetical.ts index 93ddd8f4..16e3b430 100644 --- a/src/array/alphabetical.ts +++ b/src/array/alphabetical.ts @@ -5,12 +5,12 @@ export function alphabetical( array: readonly T[], getter: (item: T) => string, - dir: 'asc' | 'desc' = 'asc', + direction: 'asc' | 'desc' = 'asc', ): T[] { if (!array) { return [] } const asc = (a: T, b: T) => `${getter(a)}`.localeCompare(getter(b)) const dsc = (a: T, b: T) => `${getter(b)}`.localeCompare(getter(a)) - return array.slice().sort(dir === 'desc' ? dsc : asc) + return array.slice().sort(direction === 'desc' ? dsc : asc) }