stuff
This commit is contained in:
17
buildfiles/node_modules/boolean/lib/boolean.ts
generated
vendored
Normal file
17
buildfiles/node_modules/boolean/lib/boolean.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
const boolean = function (value: any): boolean {
|
||||
if (typeof value === 'string') {
|
||||
return [ 'true', 't', 'yes', 'y', 'on', '1' ].includes(value.trim().toLowerCase());
|
||||
}
|
||||
|
||||
if (typeof value === 'number') {
|
||||
return value === 1;
|
||||
}
|
||||
|
||||
if (typeof value === 'boolean') {
|
||||
return value;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
export { boolean };
|
Reference in New Issue
Block a user