* Checks if a value is empty. Empty means it's either null, undefined or NaN. * Empty strings are NOT considered empty. * @param value The value to check. * @returns boolean indicating if the value is empty
(value: T)
| 92 | * @returns boolean indicating if the value is empty |
| 93 | */ |
| 94 | isEmpty<T>(value: T): boolean { |
| 95 | if (value === undefined || value === null) { |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | if (typeof value === 'bigint') { |
| 100 | return false; // BigInt values are never considered empty |
| 101 | } |
| 102 | |
| 103 | if (typeof value === 'number') { |
| 104 | return isNaN(value); |
| 105 | } |
| 106 | |
| 107 | return false; // All other types (strings, objects, arrays, etc) are not considered empty |
| 108 | } |
| 109 | |
| 110 | /** |
| 111 | * Checks if a value is a date object |
no outgoing calls
no test coverage detected