Skip to content

Commit 28a2dc0

Browse files
committed
refactor: clarify blank-string handling in where coercion
1 parent 1013af1 commit 28a2dc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parse-where.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ function coerceValue(value: string): string | number | boolean | null {
3838
if (value === 'false') return false
3939
if (value === 'null') return null
4040

41+
if (value.trim() === '') return value
42+
4143
const num = Number(value)
42-
if (Number.isFinite(num) && value.trim() !== '') return num
44+
if (Number.isFinite(num)) return num
4345

4446
return value
4547
}

0 commit comments

Comments
 (0)