mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 00:08:37 +01:00
14 lines
348 B
TypeScript
14 lines
348 B
TypeScript
|
|
|
|
export function getBoolean(value: string | number | boolean | null | undefined) {
|
|
|
|
if (typeof value === 'string') {
|
|
if (value.toLowerCase() === 'true') return true;
|
|
if (value.toLowerCase() === 'false') return false;
|
|
} else if (typeof value === 'boolean') {
|
|
return value;
|
|
} else {
|
|
return false;
|
|
}
|
|
|
|
} |