@bitty/falsy
Version:
Falsy helper functions and types for TypeScript.
27 lines (22 loc) • 979 B
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.isNullish = {}));
})(this, (function (exports) { 'use strict';
/**
* Union of values that is considered false when converted to `Boolean`.
* @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Falsy}.
* @typedef {false | void | '' | 0 | 0n | null | undefined} Falsy
*/
/**
* Check if value is falsy (`""`, `null`, `false`, `0`, `NaN` or `undefined`).
* @param {*} value - The value that will be checked.
* @returns {Boolean}
*/
function isFalsy(value) {
return !value;
}
exports.default = isFalsy;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=main.umd.js.map