@monstermann/fn
Version:
A utility library for TypeScript.
22 lines • 515 B
TypeScript
//#region src/string/parseIntOrThrow.d.ts
/**
* `parseIntOrThrow(target)`
*
* Parses `target` string and returns an integer, or throws an error if parsing fails.
*
* ```ts
* parseIntOrThrow("42"); // 42
* parseIntOrThrow("abc"); // throws FnError
* ```
*
* ```ts
* pipe("42", parseIntOrThrow()); // 42
* pipe("abc", parseIntOrThrow()); // throws FnError
* ```
*/
declare const parseIntOrThrow: {
(): (target: string) => number;
(target: string): number;
};
//#endregion
export { parseIntOrThrow };