typedash
Version:
modern, type-safe collection of utility functions
25 lines (23 loc) • 583 B
JavaScript
import { isArray } from './chunk-36F4QFCS.js';
// src/functions/isEmpty/isEmpty.ts
function isEmpty(value) {
if (value == null) {
return true;
}
if (isArray(value) || typeof value === "string") {
return value.length === 0;
}
if (value instanceof Map || value instanceof Set) {
return value.size === 0;
}
if (typeof value === "number") {
return !value;
}
if (typeof value === "object") {
return Object.keys(value).length === 0;
}
return false;
}
export { isEmpty };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-EAVBZVR4.js.map