mirror of
https://github.com/voson-wang/toon.git
synced 2026-01-29 15:24:10 +08:00
refactor: change exported functions to internal for numeric and whitespace checks
This commit is contained in:
@@ -94,12 +94,12 @@ export function isSafeUnquoted(value: string, delimiter: string = COMMA): boolea
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isNumericLike(value: string): boolean {
|
function isNumericLike(value: string): boolean {
|
||||||
// Match numbers like: 42, -3.14, 1e-6, 05, etc.
|
// Match numbers like: 42, -3.14, 1e-6, 05, etc.
|
||||||
return /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(value) || /^0\d+$/.test(value)
|
return /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(value) || /^0\d+$/.test(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPaddedWithWhitespace(value: string): boolean {
|
function isPaddedWithWhitespace(value: string): boolean {
|
||||||
return value !== value.trim()
|
return value !== value.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user