UNPKG

logitar-js

Version:

Helper functions distributed by Logitar.

13 lines (12 loc) 726 B
/** * Tries parsing a boolean from the specified value. * @param value Can be a boolean, a string or undefined. Strings are trimmed and lowercased before being compared to boolean equivalents. * @returns A boolean if the value was parsed successfully, or undefined otherwise. */ export declare function parseBoolean(value: boolean | string | undefined): boolean | undefined; /** * Tries parsing a number from the specified value. * @param value Can be a number, a string or undefined. Strings are trimmed before being converted to numbers. * @returns A number if the value was parsed successfully, or undefined otherwise. */ export declare function parseNumber(value: number | string | undefined): number | undefined;