@nexim/sanitizer
Version:
A collection of sanitization utilities for phone numbers and numeric inputs with TypeScript type safety.
12 lines • 468 B
TypeScript
/**
* Checks if a value is a valid number
* Handles: number type, string conversion, empty strings
* Uses NaN check: value - value === 0 (only true for valid numbers)
*/
export declare function isNumber(value: unknown): boolean;
/**
* Converts a value to a number or returns null if invalid
* Handles: number type, string conversion, preserves valid numbers
*/
export declare function toNumber(value: unknown): number | null;
//# sourceMappingURL=utils.d.ts.map