Prevent blank playlist names

This commit is contained in:
Bill Thornton
2024-10-13 12:00:10 -04:00
parent 363171b56d
commit a37388b2e3
3 changed files with 37 additions and 3 deletions
+9
View File
@@ -1,3 +1,12 @@
/**
* Checks if a string is empty or contains only whitespace.
* @param {string} value The string to test.
* @returns {boolean} True if the string is blank.
*/
export function isBlank(value: string | undefined | null) {
return !value?.trim().length;
}
/**
* Gets the value of a string as boolean.
* @param {string} name The value as a string.