toxic-predicate-functions
Version:
2 lines (1 loc) • 3.28 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).toxicPredicateFuntions={})}(this,function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n="object"==typeof global&&global&&global.Object===Object&&global,o="object"==typeof self&&self&&self.Object===Object&&self,r=(n||o||Function("return this")()).Symbol,i=Object.prototype,c=i.hasOwnProperty,u=i.toString,f=r?r.toStringTag:void 0;var l=Object.prototype.toString;var a="[object Null]",s="[object Undefined]",p=r?r.toStringTag:void 0;function y(t){return null==t?void 0===t?s:a:p&&p in Object(t)?function(t){var e=c.call(t,f),n=t[f];try{var o=!(t[f]=void 0)}catch(t){}var r=u.call(t);return o&&(e?t[f]=n:delete t[f]),r}(t):function(t){return l.call(t)}(t)}function b(t){return null!=t&&"object"==typeof t}var d=Array.isArray;var j,m,v=(j=Object.getPrototypeOf,m=Object,function(t){return j(m(t))}),g=Function.prototype,O=Object.prototype,S=g.toString,N=O.hasOwnProperty,h=S.call(Object);var E="[object String]";function z(t){return"string"==typeof t||!d(t)&&b(t)&&y(t)==E}function P(t){return null==t}var T="undefined"!=typeof window&&"[object Object]"!==Object.prototype.toString.call(window),w=function(t){if(!b(t)||"[object Object]"!=y(t))return!1;var e=v(t);if(null===e)return!0;var n=N.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==h};function _(t){return t instanceof Blob}function F(t){return!!("object"===("undefined"==typeof Node?"undefined":e(Node))?t instanceof Node:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName)}t.defined=function(t){return!function(t){return void 0===t}(t)},t.inBrowser=T,t.isBlob=_,t.isChildNode=function(t,e){return!(!F(t)||!F(e))&&e.parentNode===t},t.isElement=function(t){return!!("object"===("undefined"==typeof HTMLElement?"undefined":e(HTMLElement))?t instanceof HTMLElement:t&&"object"===e(t)&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)},t.isEmpty=function(t){return d(t)?0===t.length:w(t)?0===Object.keys(t).length:!t},t.isEvent=function(t){return t instanceof Event||(t&&t.originalEvent)instanceof Event},t.isFile=function(t){return t&&z(t.name)&&_(t)},t.isHTMLString=function(t){return z(t)&&/<[^>]+?>/.test(t)},t.isNode=F,t.isNumeric=function(t){return!d(t)&&0<=t-parseFloat(t)+1},t.isObject=w,t.isPosterityNode=function(t,e){if(!F(t)||!F(e))return!1;for(;e.parentNode;)if((e=e.parentNode)===t)return!0;return!1},t.isPrimitive=function(t){return!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t)},t.isPromise=function(t){return!!t&&("object"===e(t)||"function"==typeof t)&&"function"==typeof t.then},t.isUrl=function(t){return z(t)&&!!t.match(/^((https?|ftp|rtsp|mms):\/\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\.[a-z]{2,6}|localhost)(:[0-9]{1,4})?((\/?)|(\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\/?)$/i)},t.isVoid=P,Object.defineProperty(t,"__esModule",{value:!0})});