typia
Version:
Superfast runtime validators with only one line
10 lines (9 loc) • 392 B
JavaScript
//#region src/internal/_httpFormDataReadNumber.ts
const _httpFormDataReadNumber = (input) => input instanceof File ? input : !!input?.length ? input === "null" ? null : toNumber(input) : void 0;
const toNumber = (str) => {
const value = Number(str);
return isNaN(value) ? str : value;
};
//#endregion
export { _httpFormDataReadNumber };
//# sourceMappingURL=_httpFormDataReadNumber.mjs.map