68 lines
2.4 KiB
JavaScript
68 lines
2.4 KiB
JavaScript
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.returnExports = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
|
|
/**
|
|
* @file Test if a given value is falsey.
|
|
* @version 1.0.1
|
|
* @author Xotic750 <Xotic750@gmail.com>
|
|
* @copyright Xotic750
|
|
* @license {@link <https://opensource.org/licenses/MIT> MIT}
|
|
* @module is-falsey-x
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
var toBoolean = _dereq_('to-boolean-x');
|
|
|
|
/**
|
|
* This method tests if a given value is falsey.
|
|
*
|
|
* @param {*} value - The value to test.
|
|
* @returns {boolean} `true` if the value is falsey: otherwise `false`.
|
|
* @example
|
|
* var isFalsey = require('is-falsey-x');
|
|
*
|
|
* isFalsey(); // true
|
|
* isFalsey(0); // true
|
|
* isFalsey(''); // true
|
|
* isFalsey(false); // true
|
|
* isFalsey(null); // true
|
|
*
|
|
* isFalsey(true); // false
|
|
* isFalsey([]); // false
|
|
* isFalsey(1); // false
|
|
* isFalsey(function () {}); // false
|
|
*/
|
|
module.exports = function isFalsey(value) {
|
|
return toBoolean(value) === false;
|
|
};
|
|
|
|
},{"to-boolean-x":2}],2:[function(_dereq_,module,exports){
|
|
/**
|
|
* @file Converts argument to a value of type Boolean.
|
|
* @version 1.0.1
|
|
* @author Xotic750 <Xotic750@gmail.com>
|
|
* @copyright Xotic750
|
|
* @license {@link <https://opensource.org/licenses/MIT> MIT}
|
|
* @module to-boolean-x
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* The abstract operation ToBoolean converts argument to a value of type Boolean.
|
|
*
|
|
* @param {*} value - The value to be converted.
|
|
* @returns {boolean} 'true' if value is truthy; otherwise 'false'.
|
|
* @example
|
|
* var toBoolean = require('to-boolean-x');
|
|
*
|
|
* toBoolean(null); // false
|
|
* toBoolean(''); // false
|
|
* toBoolean(1); // true
|
|
* toBoolean('0'); // true
|
|
*/
|
|
module.exports = function toBoolean(value) {
|
|
return !!value;
|
|
};
|
|
|
|
},{}]},{},[1])(1)
|
|
}); |