30 lines
732 B
JavaScript
30 lines
732 B
JavaScript
/**
|
|
* @file Checks if `value` is `null` or `undefined`.
|
|
* @version 1.4.1
|
|
* @author Xotic750 <Xotic750@gmail.com>
|
|
* @copyright Xotic750
|
|
* @license {@link <https://opensource.org/licenses/MIT> MIT}
|
|
* @module is-nil-x
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var isUndefined = require('validate.io-undefined');
|
|
var isNull = require('lodash.isnull');
|
|
|
|
/**
|
|
* Checks if `value` is `null` or `undefined`.
|
|
*
|
|
* @param {*} value - The value to check.
|
|
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
|
|
* @example
|
|
* var isNil = require('is-nil-x');
|
|
*
|
|
* isNil(null); // => true
|
|
* isNil(void 0); // => true
|
|
* isNil(NaN); // => false
|
|
*/
|
|
module.exports = function isNil(value) {
|
|
return isNull(value) || isUndefined(value);
|
|
};
|