|
1
|
/** |
|
2
|
* Return true if the value is truthy and otherwise false |
|
3
|
* @param val |
|
4
|
*/ |
|
5
|
export function isTruthy(val: string | boolean | undefined): boolean { |
|
6
|
if (typeof val === "string") { |
|
7
|
return val.toLowerCase() === "true" |
|
8
|
} |
|
9
|
return !!val |
|
10
|
} |