UNPKG

@monstermann/fn

Version:

A utility library for TypeScript.

22 lines 552 B
//#region src/string/parseFloatOrThrow.d.ts /** * `parseFloatOrThrow(target)` * * Parses `target` string and returns a floating point number, or throws an error if parsing fails. * * ```ts * parseFloatOrThrow("3.14"); // 3.14 * parseFloatOrThrow("abc"); // throws FnError * ``` * * ```ts * pipe("3.14", parseFloatOrThrow()); // 3.14 * pipe("abc", parseFloatOrThrow()); // throws FnError * ``` */ declare const parseFloatOrThrow: { (): (target: string) => number; (target: string): number; }; //#endregion export { parseFloatOrThrow };