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