Fix #13, make youtube API optional

This commit is contained in:
2023-04-11 18:39:02 +02:00
parent 4fbd9a260f
commit d716b3882b
5 changed files with 24 additions and 3 deletions

7
src/lib/truthyString.ts Normal file
View 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;
}