@pluginjs/is
Advanced tools
Comparing version 0.7.7 to 0.7.8
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
/* eslint-disable */ | ||
/* Credit to http://is.js.org MIT */ | ||
const toString = Object.prototype.toString; // Type checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value Arguments? | ||
const isArguments = value => { | ||
// fallback check is for IE | ||
return toString.call(value) === '[object Arguments]' || value != null && typeof value === 'object' && 'callee' in value; | ||
}; // is a given value Array? | ||
const isArray = val => { | ||
if (Array.isArray) { | ||
return Array.isArray(val); | ||
} | ||
return toString.call(val) === '[object Array]'; | ||
}; // is a given value Boolean? | ||
const isBoolean = val => { | ||
return val === true || val === false || toString.call(val) === '[object Boolean]'; | ||
}; // is a given value Char? | ||
const isChar = val => { | ||
return isString(val) && val.length === 1; | ||
}; // is a given value Date Object? | ||
const isDate = value => { | ||
return toString.call(value) === '[object Date]'; | ||
}; // is a given object a DOM node? | ||
const isDomNode = object => { | ||
return isObject(object) && object.nodeType > 0; | ||
}; // is a given object a Element? | ||
const isElement = el => el instanceof Element; // is a given value window object | ||
const isWindow = val => { | ||
return val != null && typeof val === 'object' && 'setInterval' in val; | ||
}; // is a given value document object | ||
const isDocument = val => { | ||
return typeof val === 'object' && val.nodeType === 9; | ||
}; // is a given value Error object? | ||
const isError = val => { | ||
return toString.call(val) === '[object Error]'; | ||
}; // is a given value function? | ||
const isFunction = val => { | ||
// fallback check is for IE | ||
return toString.call(val) === '[object Function]' || typeof val === 'function'; | ||
}; // is given value a pure JSON object? | ||
const isJson = value => { | ||
return toString.call(value) === '[object Object]'; | ||
}; // is a given value NaN? | ||
const isNan = val => { | ||
// NaN is number :) Also it is the only value which does not equal itself | ||
return val !== val; | ||
}; // is a given value null? | ||
const isNull = val => { | ||
return val === null; | ||
}; // is a given value number? | ||
const isNumber = val => { | ||
return !isNan(val) && toString.call(val) === '[object Number]'; | ||
}; // is a given value object? | ||
const isObject = val => { | ||
return Object(val) === val; | ||
}; // is a given value plain object? | ||
const isPlainObject = val => { | ||
return toString.call(val) === '[object Object]'; | ||
}; // is a given value empty object? | ||
const isEmptyObject = val => { | ||
return isObject(val) && Object.getOwnPropertyNames(val).length == 0; | ||
}; // is a given value RegExp? | ||
const isRegexp = val => { | ||
return toString.call(val) === '[object RegExp]'; | ||
}; // is a given value String? | ||
const isString = val => { | ||
return typeof val === 'string' || toString.call(val) === '[object String]'; | ||
}; // is a given value undefined? | ||
const isUndefined = val => { | ||
return val === void 0; | ||
}; // is a given value Map? | ||
const isMap = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Map' : false; | ||
}; // is a given value Set? | ||
const isSet = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Set' : false; | ||
}; // is a given value Promise? | ||
const isPromise = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Promise' : false; | ||
}; // is a given value Symbol? | ||
const isSymbol = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Symbol' : false; | ||
}; // is a given value is empty | ||
const isEmpty = val => { | ||
return isNumber(val) && val === 0 || isArray(val) && val.length === 0 || isString(val) && val === '' || isEmptyObject(val) || isNull(val) || isUndefined(val) || val === false; | ||
}; // Arithmetic checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value numeric? | ||
const isNumeric = n => { | ||
return (isNumber(n) || isString(n)) && !isNan(n - parseFloat(n)); | ||
}; // is a given number percentage? | ||
const isPercentage = n => { | ||
return typeof n === 'string' && n.indexOf('%') !== -1; | ||
}; // is a given number decimal? | ||
const isDecimal = n => { | ||
return isNumber(n) && n % 1 !== 0; | ||
}; // is a given number finite? | ||
const isFinite = n => { | ||
return !isInfinite(n) && !isNan(n); | ||
}; // is a given number infinite? | ||
const isInfinite = n => { | ||
return n === Infinity || n === -Infinity; | ||
}; | ||
const isInteger = n => { | ||
return isNumber(n) && n % 1 === 0; | ||
}; // is a given number negative? | ||
const isNegative = n => { | ||
return isNumber(n) && n < 0; | ||
}; // is a given number positive? | ||
const isPositive = n => { | ||
return isNumber(n) && n > 0; | ||
}; | ||
exports.isArguments = isArguments; | ||
exports.isArray = isArray; | ||
exports.isBoolean = isBoolean; | ||
exports.isChar = isChar; | ||
exports.isDate = isDate; | ||
exports.isDomNode = isDomNode; | ||
exports.isElement = isElement; | ||
exports.isWindow = isWindow; | ||
exports.isDocument = isDocument; | ||
exports.isError = isError; | ||
exports.isFunction = isFunction; | ||
exports.isJson = isJson; | ||
exports.isNan = isNan; | ||
exports.isNull = isNull; | ||
exports.isNumber = isNumber; | ||
exports.isObject = isObject; | ||
exports.isPlainObject = isPlainObject; | ||
exports.isEmptyObject = isEmptyObject; | ||
exports.isRegexp = isRegexp; | ||
exports.isString = isString; | ||
exports.isUndefined = isUndefined; | ||
exports.isMap = isMap; | ||
exports.isSet = isSet; | ||
exports.isPromise = isPromise; | ||
exports.isSymbol = isSymbol; | ||
exports.isEmpty = isEmpty; | ||
exports.isNumeric = isNumeric; | ||
exports.isPercentage = isPercentage; | ||
exports.isDecimal = isDecimal; | ||
exports.isFinite = isFinite; | ||
exports.isInfinite = isInfinite; | ||
exports.isInteger = isInteger; | ||
exports.isNegative = isNegative; | ||
exports.isPositive = isPositive; | ||
undefined |
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const toString=Object.prototype.toString,isArguments=i=>"[object Arguments]"===toString.call(i)||null!=i&&"object"==typeof i&&"callee"in i,isArray=i=>Array.isArray?Array.isArray(i):"[object Array]"===toString.call(i),isBoolean=i=>!0===i||!1===i||"[object Boolean]"===toString.call(i),isChar=i=>isString(i)&&1===i.length,isDate=i=>"[object Date]"===toString.call(i),isDomNode=i=>isObject(i)&&i.nodeType>0,isElement=i=>i instanceof Element,isWindow=i=>null!=i&&"object"==typeof i&&"setInterval"in i,isDocument=i=>"object"==typeof i&&9===i.nodeType,isError=i=>"[object Error]"===toString.call(i),isFunction=i=>"[object Function]"===toString.call(i)||"function"==typeof i,isJson=i=>"[object Object]"===toString.call(i),isNan=i=>i!=i,isNull=i=>null===i,isNumber=i=>!isNan(i)&&"[object Number]"===toString.call(i),isObject=i=>Object(i)===i,isPlainObject=i=>"[object Object]"===toString.call(i),isEmptyObject=i=>isObject(i)&&0==Object.getOwnPropertyNames(i).length,isRegexp=i=>"[object RegExp]"===toString.call(i),isString=i=>"string"==typeof i||"[object String]"===toString.call(i),isUndefined=i=>void 0===i,isMap=i=>!(null==i||!i.constructor)&&"Map"===i.constructor.name,isSet=i=>!(null==i||!i.constructor)&&"Set"===i.constructor.name,isPromise=i=>!(null==i||!i.constructor)&&"Promise"===i.constructor.name,isSymbol=i=>!(null==i||!i.constructor)&&"Symbol"===i.constructor.name,isEmpty=i=>isNumber(i)&&0===i||isArray(i)&&0===i.length||isString(i)&&""===i||isEmptyObject(i)||isNull(i)||isUndefined(i)||!1===i,isNumeric=i=>(isNumber(i)||isString(i))&&!isNan(i-parseFloat(i)),isPercentage=i=>"string"==typeof i&&-1!==i.indexOf("%"),isDecimal=i=>isNumber(i)&&i%1!=0,isFinite=i=>!isInfinite(i)&&!isNan(i),isInfinite=i=>i===1/0||i===-1/0,isInteger=i=>isNumber(i)&&i%1==0,isNegative=i=>isNumber(i)&&i<0,isPositive=i=>isNumber(i)&&i>0;exports.isArguments=isArguments,exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isChar=isChar,exports.isDate=isDate,exports.isDomNode=isDomNode,exports.isElement=isElement,exports.isWindow=isWindow,exports.isDocument=isDocument,exports.isError=isError,exports.isFunction=isFunction,exports.isJson=isJson,exports.isNan=isNan,exports.isNull=isNull,exports.isNumber=isNumber,exports.isObject=isObject,exports.isPlainObject=isPlainObject,exports.isEmptyObject=isEmptyObject,exports.isRegexp=isRegexp,exports.isString=isString,exports.isUndefined=isUndefined,exports.isMap=isMap,exports.isSet=isSet,exports.isPromise=isPromise,exports.isSymbol=isSymbol,exports.isEmpty=isEmpty,exports.isNumeric=isNumeric,exports.isPercentage=isPercentage,exports.isDecimal=isDecimal,exports.isFinite=isFinite,exports.isInfinite=isInfinite,exports.isInteger=isInteger,exports.isNegative=isNegative,exports.isPositive=isPositive; | ||
undefined |
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
/* eslint-disable */ | ||
/* Credit to http://is.js.org MIT */ | ||
const toString = Object.prototype.toString; // Type checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value Arguments? | ||
const isArguments = value => { | ||
// fallback check is for IE | ||
return toString.call(value) === '[object Arguments]' || value != null && typeof value === 'object' && 'callee' in value; | ||
}; // is a given value Array? | ||
const isArray = val => { | ||
if (Array.isArray) { | ||
return Array.isArray(val); | ||
} | ||
return toString.call(val) === '[object Array]'; | ||
}; // is a given value Boolean? | ||
const isBoolean = val => { | ||
return val === true || val === false || toString.call(val) === '[object Boolean]'; | ||
}; // is a given value Char? | ||
const isChar = val => { | ||
return isString(val) && val.length === 1; | ||
}; // is a given value Date Object? | ||
const isDate = value => { | ||
return toString.call(value) === '[object Date]'; | ||
}; // is a given object a DOM node? | ||
const isDomNode = object => { | ||
return isObject(object) && object.nodeType > 0; | ||
}; // is a given object a Element? | ||
const isElement = el => el instanceof Element; // is a given value window object | ||
const isWindow = val => { | ||
return val != null && typeof val === 'object' && 'setInterval' in val; | ||
}; // is a given value document object | ||
const isDocument = val => { | ||
return typeof val === 'object' && val.nodeType === 9; | ||
}; // is a given value Error object? | ||
const isError = val => { | ||
return toString.call(val) === '[object Error]'; | ||
}; // is a given value function? | ||
const isFunction = val => { | ||
// fallback check is for IE | ||
return toString.call(val) === '[object Function]' || typeof val === 'function'; | ||
}; // is given value a pure JSON object? | ||
const isJson = value => { | ||
return toString.call(value) === '[object Object]'; | ||
}; // is a given value NaN? | ||
const isNan = val => { | ||
// NaN is number :) Also it is the only value which does not equal itself | ||
return val !== val; | ||
}; // is a given value null? | ||
const isNull = val => { | ||
return val === null; | ||
}; // is a given value number? | ||
const isNumber = val => { | ||
return !isNan(val) && toString.call(val) === '[object Number]'; | ||
}; // is a given value object? | ||
const isObject = val => { | ||
return Object(val) === val; | ||
}; // is a given value plain object? | ||
const isPlainObject = val => { | ||
return toString.call(val) === '[object Object]'; | ||
}; // is a given value empty object? | ||
const isEmptyObject = val => { | ||
return isObject(val) && Object.getOwnPropertyNames(val).length == 0; | ||
}; // is a given value RegExp? | ||
const isRegexp = val => { | ||
return toString.call(val) === '[object RegExp]'; | ||
}; // is a given value String? | ||
const isString = val => { | ||
return typeof val === 'string' || toString.call(val) === '[object String]'; | ||
}; // is a given value undefined? | ||
const isUndefined = val => { | ||
return val === void 0; | ||
}; // is a given value Map? | ||
const isMap = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Map' : false; | ||
}; // is a given value Set? | ||
const isSet = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Set' : false; | ||
}; // is a given value Promise? | ||
const isPromise = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Promise' : false; | ||
}; // is a given value Symbol? | ||
const isSymbol = val => { | ||
return val != null && val.constructor ? val.constructor.name === 'Symbol' : false; | ||
}; // is a given value is empty | ||
const isEmpty = val => { | ||
return isNumber(val) && val === 0 || isArray(val) && val.length === 0 || isString(val) && val === '' || isEmptyObject(val) || isNull(val) || isUndefined(val) || val === false; | ||
}; // Arithmetic checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value numeric? | ||
const isNumeric = n => { | ||
return (isNumber(n) || isString(n)) && !isNan(n - parseFloat(n)); | ||
}; // is a given number percentage? | ||
const isPercentage = n => { | ||
return typeof n === 'string' && n.indexOf('%') !== -1; | ||
}; // is a given number decimal? | ||
const isDecimal = n => { | ||
return isNumber(n) && n % 1 !== 0; | ||
}; // is a given number finite? | ||
const isFinite = n => { | ||
return !isInfinite(n) && !isNan(n); | ||
}; // is a given number infinite? | ||
const isInfinite = n => { | ||
return n === Infinity || n === -Infinity; | ||
}; | ||
const isInteger = n => { | ||
return isNumber(n) && n % 1 === 0; | ||
}; // is a given number negative? | ||
const isNegative = n => { | ||
return isNumber(n) && n < 0; | ||
}; // is a given number positive? | ||
const isPositive = n => { | ||
return isNumber(n) && n > 0; | ||
}; | ||
export { isArguments, isArray, isBoolean, isChar, isDate, isDomNode, isElement, isWindow, isDocument, isError, isFunction, isJson, isNan, isNull, isNumber, isObject, isPlainObject, isEmptyObject, isRegexp, isString, isUndefined, isMap, isSet, isPromise, isSymbol, isEmpty, isNumeric, isPercentage, isDecimal, isFinite, isInfinite, isInteger, isNegative, isPositive }; | ||
undefined |
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
const toString=Object.prototype.toString,isArguments=i=>"[object Arguments]"===toString.call(i)||null!=i&&"object"==typeof i&&"callee"in i,isArray=i=>Array.isArray?Array.isArray(i):"[object Array]"===toString.call(i),isBoolean=i=>!0===i||!1===i||"[object Boolean]"===toString.call(i),isChar=i=>isString(i)&&1===i.length,isDate=i=>"[object Date]"===toString.call(i),isDomNode=i=>isObject(i)&&i.nodeType>0,isElement=i=>i instanceof Element,isWindow=i=>null!=i&&"object"==typeof i&&"setInterval"in i,isDocument=i=>"object"==typeof i&&9===i.nodeType,isError=i=>"[object Error]"===toString.call(i),isFunction=i=>"[object Function]"===toString.call(i)||"function"==typeof i,isJson=i=>"[object Object]"===toString.call(i),isNan=i=>i!=i,isNull=i=>null===i,isNumber=i=>!isNan(i)&&"[object Number]"===toString.call(i),isObject=i=>Object(i)===i,isPlainObject=i=>"[object Object]"===toString.call(i),isEmptyObject=i=>isObject(i)&&0==Object.getOwnPropertyNames(i).length,isRegexp=i=>"[object RegExp]"===toString.call(i),isString=i=>"string"==typeof i||"[object String]"===toString.call(i),isUndefined=i=>void 0===i,isMap=i=>!(null==i||!i.constructor)&&"Map"===i.constructor.name,isSet=i=>!(null==i||!i.constructor)&&"Set"===i.constructor.name,isPromise=i=>!(null==i||!i.constructor)&&"Promise"===i.constructor.name,isSymbol=i=>!(null==i||!i.constructor)&&"Symbol"===i.constructor.name,isEmpty=i=>isNumber(i)&&0===i||isArray(i)&&0===i.length||isString(i)&&""===i||isEmptyObject(i)||isNull(i)||isUndefined(i)||!1===i,isNumeric=i=>(isNumber(i)||isString(i))&&!isNan(i-parseFloat(i)),isPercentage=i=>"string"==typeof i&&-1!==i.indexOf("%"),isDecimal=i=>isNumber(i)&&i%1!=0,isFinite=i=>!isInfinite(i)&&!isNan(i),isInfinite=i=>i===1/0||i===-1/0,isInteger=i=>isNumber(i)&&i%1==0,isNegative=i=>isNumber(i)&&i<0,isPositive=i=>isNumber(i)&&i>0;export{isArguments,isArray,isBoolean,isChar,isDate,isDomNode,isElement,isWindow,isDocument,isError,isFunction,isJson,isNan,isNull,isNumber,isObject,isPlainObject,isEmptyObject,isRegexp,isString,isUndefined,isMap,isSet,isPromise,isSymbol,isEmpty,isNumeric,isPercentage,isDecimal,isFinite,isInfinite,isInteger,isNegative,isPositive}; | ||
undefined |
214
dist/is.js
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global['@pluginjs/is'] = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
function _typeof(obj) { | ||
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { | ||
_typeof = function (obj) { | ||
return typeof obj; | ||
}; | ||
} else { | ||
_typeof = function (obj) { | ||
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | ||
}; | ||
} | ||
return _typeof(obj); | ||
} | ||
/* eslint-disable */ | ||
/* Credit to http://is.js.org MIT */ | ||
var toString = Object.prototype.toString; // Type checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value Arguments? | ||
var isArguments = function isArguments(value) { | ||
// fallback check is for IE | ||
return toString.call(value) === '[object Arguments]' || value != null && _typeof(value) === 'object' && 'callee' in value; | ||
}; // is a given value Array? | ||
var isArray = function isArray(val) { | ||
if (Array.isArray) { | ||
return Array.isArray(val); | ||
} | ||
return toString.call(val) === '[object Array]'; | ||
}; // is a given value Boolean? | ||
var isBoolean = function isBoolean(val) { | ||
return val === true || val === false || toString.call(val) === '[object Boolean]'; | ||
}; // is a given value Char? | ||
var isChar = function isChar(val) { | ||
return isString(val) && val.length === 1; | ||
}; // is a given value Date Object? | ||
var isDate = function isDate(value) { | ||
return toString.call(value) === '[object Date]'; | ||
}; // is a given object a DOM node? | ||
var isDomNode = function isDomNode(object) { | ||
return isObject(object) && object.nodeType > 0; | ||
}; // is a given object a Element? | ||
var isElement = function isElement(el) { | ||
return el instanceof Element; | ||
}; // is a given value window object | ||
var isWindow = function isWindow(val) { | ||
return val != null && _typeof(val) === 'object' && 'setInterval' in val; | ||
}; // is a given value document object | ||
var isDocument = function isDocument(val) { | ||
return _typeof(val) === 'object' && val.nodeType === 9; | ||
}; // is a given value Error object? | ||
var isError = function isError(val) { | ||
return toString.call(val) === '[object Error]'; | ||
}; // is a given value function? | ||
var isFunction = function isFunction(val) { | ||
// fallback check is for IE | ||
return toString.call(val) === '[object Function]' || typeof val === 'function'; | ||
}; // is given value a pure JSON object? | ||
var isJson = function isJson(value) { | ||
return toString.call(value) === '[object Object]'; | ||
}; // is a given value NaN? | ||
var isNan = function isNan(val) { | ||
// NaN is number :) Also it is the only value which does not equal itself | ||
return val !== val; | ||
}; // is a given value null? | ||
var isNull = function isNull(val) { | ||
return val === null; | ||
}; // is a given value number? | ||
var isNumber = function isNumber(val) { | ||
return !isNan(val) && toString.call(val) === '[object Number]'; | ||
}; // is a given value object? | ||
var isObject = function isObject(val) { | ||
return Object(val) === val; | ||
}; // is a given value plain object? | ||
var isPlainObject = function isPlainObject(val) { | ||
return toString.call(val) === '[object Object]'; | ||
}; // is a given value empty object? | ||
var isEmptyObject = function isEmptyObject(val) { | ||
return isObject(val) && Object.getOwnPropertyNames(val).length == 0; | ||
}; // is a given value RegExp? | ||
var isRegexp = function isRegexp(val) { | ||
return toString.call(val) === '[object RegExp]'; | ||
}; // is a given value String? | ||
var isString = function isString(val) { | ||
return typeof val === 'string' || toString.call(val) === '[object String]'; | ||
}; // is a given value undefined? | ||
var isUndefined = function isUndefined(val) { | ||
return val === void 0; | ||
}; // is a given value Map? | ||
var isMap = function isMap(val) { | ||
return val != null && val.constructor ? val.constructor.name === 'Map' : false; | ||
}; // is a given value Set? | ||
var isSet = function isSet(val) { | ||
return val != null && val.constructor ? val.constructor.name === 'Set' : false; | ||
}; // is a given value Promise? | ||
var isPromise = function isPromise(val) { | ||
return val != null && val.constructor ? val.constructor.name === 'Promise' : false; | ||
}; // is a given value Symbol? | ||
var isSymbol = function isSymbol(val) { | ||
return val != null && val.constructor ? val.constructor.name === 'Symbol' : false; | ||
}; // is a given value is empty | ||
var isEmpty = function isEmpty(val) { | ||
return isNumber(val) && val === 0 || isArray(val) && val.length === 0 || isString(val) && val === '' || isEmptyObject(val) || isNull(val) || isUndefined(val) || val === false; | ||
}; // Arithmetic checks | ||
/* -------------------------------------------------------------------------- */ | ||
// is a given value numeric? | ||
var isNumeric = function isNumeric(n) { | ||
return (isNumber(n) || isString(n)) && !isNan(n - parseFloat(n)); | ||
}; // is a given number percentage? | ||
var isPercentage = function isPercentage(n) { | ||
return typeof n === 'string' && n.indexOf('%') !== -1; | ||
}; // is a given number decimal? | ||
var isDecimal = function isDecimal(n) { | ||
return isNumber(n) && n % 1 !== 0; | ||
}; // is a given number finite? | ||
var isFinite = function isFinite(n) { | ||
return !isInfinite(n) && !isNan(n); | ||
}; // is a given number infinite? | ||
var isInfinite = function isInfinite(n) { | ||
return n === Infinity || n === -Infinity; | ||
}; | ||
var isInteger = function isInteger(n) { | ||
return isNumber(n) && n % 1 === 0; | ||
}; // is a given number negative? | ||
var isNegative = function isNegative(n) { | ||
return isNumber(n) && n < 0; | ||
}; // is a given number positive? | ||
var isPositive = function isPositive(n) { | ||
return isNumber(n) && n > 0; | ||
}; | ||
exports.isArguments = isArguments; | ||
exports.isArray = isArray; | ||
exports.isBoolean = isBoolean; | ||
exports.isChar = isChar; | ||
exports.isDate = isDate; | ||
exports.isDomNode = isDomNode; | ||
exports.isElement = isElement; | ||
exports.isWindow = isWindow; | ||
exports.isDocument = isDocument; | ||
exports.isError = isError; | ||
exports.isFunction = isFunction; | ||
exports.isJson = isJson; | ||
exports.isNan = isNan; | ||
exports.isNull = isNull; | ||
exports.isNumber = isNumber; | ||
exports.isObject = isObject; | ||
exports.isPlainObject = isPlainObject; | ||
exports.isEmptyObject = isEmptyObject; | ||
exports.isRegexp = isRegexp; | ||
exports.isString = isString; | ||
exports.isUndefined = isUndefined; | ||
exports.isMap = isMap; | ||
exports.isSet = isSet; | ||
exports.isPromise = isPromise; | ||
exports.isSymbol = isSymbol; | ||
exports.isEmpty = isEmpty; | ||
exports.isNumeric = isNumeric; | ||
exports.isPercentage = isPercentage; | ||
exports.isDecimal = isDecimal; | ||
exports.isFinite = isFinite; | ||
exports.isInfinite = isInfinite; | ||
exports.isInteger = isInteger; | ||
exports.isNegative = isNegative; | ||
exports.isPositive = isPositive; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
undefined |
/*! | ||
* @pluginjs/is v0.7.7 (https://pluginjs.com) | ||
* @pluginjs/is v0.7.8 (https://pluginjs.com) | ||
* Copyright 2019 Creation Studio Limited | ||
* Released under the GPL-3.0 License. | ||
*/ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n["@pluginjs/is"]={})}(this,function(n){"use strict";function t(n){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}var e=Object.prototype.toString,r=function(n){return Array.isArray?Array.isArray(n):"[object Array]"===e.call(n)},o=function(n){return n!=n},i=function(n){return null===n},u=function(n){return!o(n)&&"[object Number]"===e.call(n)},c=function(n){return Object(n)===n},s=function(n){return c(n)&&0==Object.getOwnPropertyNames(n).length},l=function(n){return"string"==typeof n||"[object String]"===e.call(n)},f=function(n){return void 0===n},a=function(n){return n===1/0||n===-1/0};n.isArguments=function(n){return"[object Arguments]"===e.call(n)||null!=n&&"object"===t(n)&&"callee"in n},n.isArray=r,n.isBoolean=function(n){return!0===n||!1===n||"[object Boolean]"===e.call(n)},n.isChar=function(n){return l(n)&&1===n.length},n.isDate=function(n){return"[object Date]"===e.call(n)},n.isDomNode=function(n){return c(n)&&n.nodeType>0},n.isElement=function(n){return n instanceof Element},n.isWindow=function(n){return null!=n&&"object"===t(n)&&"setInterval"in n},n.isDocument=function(n){return"object"===t(n)&&9===n.nodeType},n.isError=function(n){return"[object Error]"===e.call(n)},n.isFunction=function(n){return"[object Function]"===e.call(n)||"function"==typeof n},n.isJson=function(n){return"[object Object]"===e.call(n)},n.isNan=o,n.isNull=i,n.isNumber=u,n.isObject=c,n.isPlainObject=function(n){return"[object Object]"===e.call(n)},n.isEmptyObject=s,n.isRegexp=function(n){return"[object RegExp]"===e.call(n)},n.isString=l,n.isUndefined=f,n.isMap=function(n){return!(null==n||!n.constructor)&&"Map"===n.constructor.name},n.isSet=function(n){return!(null==n||!n.constructor)&&"Set"===n.constructor.name},n.isPromise=function(n){return!(null==n||!n.constructor)&&"Promise"===n.constructor.name},n.isSymbol=function(n){return!(null==n||!n.constructor)&&"Symbol"===n.constructor.name},n.isEmpty=function(n){return u(n)&&0===n||r(n)&&0===n.length||l(n)&&""===n||s(n)||i(n)||f(n)||!1===n},n.isNumeric=function(n){return(u(n)||l(n))&&!o(n-parseFloat(n))},n.isPercentage=function(n){return"string"==typeof n&&-1!==n.indexOf("%")},n.isDecimal=function(n){return u(n)&&n%1!=0},n.isFinite=function(n){return!a(n)&&!o(n)},n.isInfinite=a,n.isInteger=function(n){return u(n)&&n%1==0},n.isNegative=function(n){return u(n)&&n<0},n.isPositive=function(n){return u(n)&&n>0},Object.defineProperty(n,"__esModule",{value:!0})}); | ||
undefined |
@@ -14,3 +14,3 @@ { | ||
}, | ||
"version": "0.7.7", | ||
"version": "0.7.8", | ||
"category": "utils", | ||
@@ -37,5 +37,5 @@ "main": "dist/is.common.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.4.0", | ||
"@pluginjs/browserslist-config": "^1.2.4", | ||
"@pluginjs/cli": "^0.7.7", | ||
"@babel/core": "^7.4.4", | ||
"@pluginjs/browserslist-config": "^1.2.5", | ||
"@pluginjs/cli": "^0.7.8", | ||
"babel-jest": "*", | ||
@@ -66,4 +66,3 @@ "jest": "*", | ||
], | ||
"title": "Plugin", | ||
"gitHead": "7ab88df9e09e1806fcb145cd856bf004f3684a74" | ||
"title": "Plugin" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
13580
9
187
1