improve type guards

This commit is contained in:
Ollie Taylor
2023-02-23 00:39:46 +00:00
parent c1f1131c7c
commit 8d4afbd7ff
4 changed files with 20 additions and 20 deletions
+7
View File
@@ -0,0 +1,7 @@
export function isBoolean(value: any): value is boolean {
return typeof value === 'boolean';
}
export function isNumber(value: any): value is number {
return typeof value === 'number' && !isNaN(value);
}