Fix #13, make youtube API optional
This commit is contained in:
7
src/lib/truthyString.ts
Normal file
7
src/lib/truthyString.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export function isTruthy(value: string | number | boolean | null | undefined): boolean {
|
||||
if (typeof value === 'string') {
|
||||
return value.toLowerCase() === 'true' || !!+value; // here we parse to number first
|
||||
}
|
||||
|
||||
return !!value;
|
||||
}
|
Reference in New Issue
Block a user