From a639b4858c4df315461f6909685b6bc968fb8bdd Mon Sep 17 00:00:00 2001 From: Alec Larson <1925840+aleclarson@users.noreply.github.com> Date: Tue, 2 Jul 2024 12:41:44 -0400 Subject: [PATCH] refactor: rename `dir` argument to `direction` --- src/array/alphabetical.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }