@technobuddha/library
Version:
A large library of useful functions
17 lines (16 loc) • 609 B
TypeScript
declare type Options = {
/** An iterable list of values that are "true" */
trueValues?: Iterable<string | RegExp>;
/** An iterable list of values that are "true" */
falseValues?: Iterable<string | RegExp>;
};
/**
* Convert a string to a boolean value
*
* @param input The string to convert
* @parm __namedParameters see {@link Options}
* @defaults trueValues 'true', 'yes', 'y', 'on', or '1'
* @defaults falseValues 'false', 'no', 'n', 'off', '0'
*/
export declare function toBoolean(input: string, { trueValues, falseValues }?: Options): boolean | undefined;
export default toBoolean;