handle timer type whitespace (#1225)

This commit is contained in:
Alex Christoffer Rasmussen
2024-09-28 20:34:04 +02:00
committed by GitHub
parent 8a5cef79a8
commit 78e2f217a4
3 changed files with 157 additions and 24 deletions
+2 -2
View File
@@ -8,9 +8,9 @@ import { deepmerge } from 'ontime-utils';
* @returns {string} - value as string or fallback if not possible
*/
export const makeString = (val: unknown, fallback = ''): string => {
if (typeof val === 'string') return val;
if (typeof val === 'string') return val.trim();
else if (val == null || val.constructor === Object) return fallback;
return val.toString();
return val.toString().trim();
};
/**