Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
poteat committed Dec 15, 2024
1 parent c7d3e31 commit 50863cc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/list/compare-by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export const compareBy = ((
// Apply custom comparator
// Each comparator is a 2-ary kind reified as a function taking `a` then `b`.
// In runtime form, we assume the comparator returns a number like -1, 0, or 1.
result = comparators[i](a)(b) as number
result = comparators[i](a)(b)
} else {
// Fallback to default logic
const aIsNumber = typeof a === 'number'
Expand Down
4 changes: 2 additions & 2 deletions src/list/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ export const compare = ((x: (string | number)[]) =>

// Both are numbers
if (aIsNumber && bIsNumber) {
const diff = (a as number) - (b as number)
const diff = a - b
if (diff < 0) return -1
if (diff > 0) return 1
// if diff === 0, continue
}

// Both are strings
if (!aIsNumber && !bIsNumber) {
const diff = (a as string).localeCompare(b as string)
const diff = a.localeCompare(b)
if (diff < 0) return -1
if (diff > 0) return 1
// if diff === 0, continue
Expand Down
2 changes: 1 addition & 1 deletion src/type/type-of.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Kind, Type } from '..'
import { Kind } from '..'

/**
* `_$typeOf` is a helper type that returns the runtime-like `typeof` result as a string literal.
Expand Down

0 comments on commit 50863cc

Please sign in to comment.