-
Notifications
You must be signed in to change notification settings - Fork 0
/
type.min.js
3 lines (3 loc) · 3.32 KB
/
type.min.js
1
2
3
/*! lil-type - v0.1.2 - MIT License - https://github.com/lil-js/type */
(function(e,t){if(typeof define==="function"&&define.amd){define(["exports"],t)}else if(typeof exports==="object"){t(exports);if(typeof module==="object"&&module!==null){module.exports=exports}}else{t(e.lil=e.lil||{})}})(this,function(e){"use strict";var t="0.1.2";var n=Object.prototype.toString;var r=isFinite;var i=Array.isArray;var o=Object.keys;var l=/[U]?Int|Float[0-9]{1,2}Array\]$/i;var a=["Boolean","NaN","Number","String","Null","Undefined","RegExp","Date","Function","Symbol","Arguments","Error","Array","Element","Generator","Map","WeakMap","WeakSet","Binary","Object"];e.type={VERSION:t};function u(e){return e===null}e.isNull=u;function f(e){return e&&n.call(e)==="[object Object]"||false}e.isObject=f;e.isPlainObject=function P(e){return f(e)&&f(Object.getPrototypeOf(e))&&u(Object.getPrototypeOf(Object.getPrototypeOf(e)))};function c(e){return i?i(e):e&&n.call(e)==="[object Array]"||false}e.isArray=c;function s(e){return e&&l.test(n.call(e))||false}e.isTypedArray=s;function b(e){return typeof e==="function"}e.isFn=e.isFunction=b;function p(e){return e===true||e===false||e&&n.call(e)==="[object Boolean]"||false}e.isBool=e.isBoolean=p;function y(e){return e&&n.call(e)==="[object Date]"||false}e.isDate=y;e.isElement=function W(e){return e&&e.nodeType===1||false};function j(e){return typeof e==="string"||e&&typeof e==="object"&&n.call(e)==="[object String]"||false}e.isString=j;function d(e){return typeof e==="number"||e&&typeof e==="object"&&n.call(e)==="[object Number]"||false}e.isNumber=d;function m(e){return e&&n.call(e)==="[object RegExp]"||false}e.isRegExp=m;function g(e){return d(e)&&e!=+e}e.isNaN=g;e.isFinite=function h(e){return r(e)&&!g(parseFloat(e))||false};function O(e){return e&&n.call(e).indexOf("Error")!==-1||false}e.isError=O;var B=e.isMap=function R(e){return e&&n.call(e)==="[object Map]"||false};var v=e.isWeakMap=E("WeakMap");var A=e.isWeakSet=E("WeakSet");function E(e){return function t(r){return r&&n.call(r)==="[object "+e+"]"||false}}e.isPromise=function D(e){return f(e)&&b(e.then)||false};e.isGenerator=function I(e){return f(e)&&b(e.next)&&b(e.send)||false};e.isBuffer=function T(e){return e&&n.call(e)==="[object Buffer]"||n.call(e)==="[object ArrayBuffer]"||n.call(e)==="[object DataView]"||false};function S(e){return e&&n.call(e)==="[object Blob]"||n.call(e)==="[object BlobBuilder]"||false}e.isBlob=S;function x(e){return e&&n.call(e)==="[object File]"||n.call(e)==="[object FileReader]"||false}e.isBlob=x;e.isBinary=function U(e){return e&&S(e)||x(e)||s(e)||false};function F(e){return typeof e==="undefined"}e.isUndefined=F;function N(e){return e&&n.call(e)==="[object Symbol]"||false}e.isSymbol=N;function k(e){return e&&n.call(e)==="[object Arguments]"||false}e.isArguments=k;function M(e){if(!e)return true;if(j(e)||c(e))return e.length===0;if(f(e))return o(e).length===0;return false}e.isEmpty=M;e.notEmpty=function(e){return!M(e)};e.isMutable=function w(e){return f(e)&&!Object.isFrozen(e)||c(e)||O(e)||k(e)||y(e)||b(e)||false};e.isIterable=function G(e){return f(e)||c(e)||k(e)||B(e)||v(e)||A(e)||false};e.isPrimitive=function(e){return p(e)||j(e)||d(e)||b(e)||u(e)||F(e)||m(e)||N(e)||false};e.is=e.isType=function V(t){for(var n=0,r=a.length;n<r;n+=1){if(e["is"+a[n]](t)){return a[n].toLowerCase()}}return"undefined"}});
//# sourceMappingURL=type.min.js.map