ramda-adjunct
Version:
Ramda Adjunct is the most popular and most comprehensive set of utilities for use with Ramda, providing a variety of useful, well tested functions with excellent documentation.
28 lines (27 loc) • 932 B
JavaScript
exports.__esModule = true;
exports["default"] = void 0;
var _ramda = require("ramda");
/**
* Returns `true` if the given value is its type's empty value, `null` or `undefined`.
*
* @func isNilOrEmpty
* @memberOf RA
* @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
* @category Type
* @sig * -> Boolean
* @param {*} val The value to test
* @return {boolean}
* @see {@link http://ramdajs.com/docs/#isEmpty|R.isEmpty}, {@link http://ramdajs.com/docs/#isNil|R.isNil}
* @example
*
* RA.isNilOrEmpty([1, 2, 3]); //=> false
* RA.isNilOrEmpty([]); //=> true
* RA.isNilOrEmpty(''); //=> true
* RA.isNilOrEmpty(null); //=> true
* RA.isNilOrEmpty(undefined): //=> true
* RA.isNilOrEmpty({}); //=> true
* RA.isNilOrEmpty({length: 0}); //=> false
*/
var isNilOrEmpty = (0, _ramda.curryN)(1, (0, _ramda.either)(_ramda.isNil, _ramda.isEmpty));
var _default = exports["default"] = isNilOrEmpty;
;