MCPcopy Index your code
hub / github.com/javascriptdata/danfojs / isEmpty

Method isEmpty

src/danfojs-base/shared/utils.ts:94–108  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 15

$typeCheckerMethod · 0.95
isNaMethod · 0.80
fillNaMethod · 0.80
toLowerCaseMethod · 0.80
toUpperCaseMethod · 0.80
capitalizeMethod · 0.80
charAtMethod · 0.80
concatMethod · 0.80
startsWithMethod · 0.80
endsWithMethod · 0.80
includesMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected