is-function-x
Version:
Determine whether a given value is a function object.
15 lines • 11.8 kB
JavaScript
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2015-present",
"date": "2019-08-28T16:59:18.827Z",
"describe": "",
"description": "Determine whether a given value is a function object.",
"file": "is-function-x.min.js",
"hash": "8d070db0fcc24dcbfaf4",
"license": "MIT",
"version": "4.1.2"
}
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.isFunctionX=t():e.isFunctionX=t()}(function(){"use strict";var e,t={}.constructor,n=t.prototype,r=t.defineProperty,o=function(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0},i=function(){return this};try{return r?r(n,"$$globalThis$$",{get:i,configurable:!0}):n.__defineGetter__("$$globalThis$$",i),e="undefined"==typeof $$globalThis$$?o():$$globalThis$$,delete n.$$globalThis$$,e}catch(e){return o()}}(),function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t,n){"use strict";var r=Object.prototype.toString;if(n(2)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;e.exports=function(e){if("symbol"==typeof e)return!0;if("[object Symbol]"!==r.call(e))return!1;try{return function(e){return"symbol"==typeof e.valueOf()&&i.test(o.call(e))}(e)}catch(e){return!1}}}else e.exports=function(e){return!1}},function(e,t,n){"use strict";var r=String.prototype.valueOf,o=Object.prototype.toString,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){return"string"==typeof e||"object"==typeof e&&(i?function(e){try{return r.call(e),!0}catch(e){return!1}}(e):"[object String]"===o.call(e))}},function(e,t,n){"use strict";(function(t){var r=t.Symbol,o=n(4);e.exports=function(){return"function"==typeof r&&("function"==typeof Symbol&&("symbol"==typeof r("foo")&&("symbol"==typeof Symbol("bar")&&o())))}}).call(this,n(3))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.r(t);var o=function(e){return"object"===r(e)?null===e:"function"!=typeof e},i=n(1),c=n.n(i),s={}.constructor("a"),u="a"===s[0]&&0 in s,f=function(){}.bind,a="function"==typeof f&&function(){var e=null,t=null,n=null,r=[];try{var o=f.apply(function(r,o){return n=this,e=r,t=o,arguments},[r,1]),i=o(2);return 1===o.length&&2===i.length&&1===e&&2===t&&n===r}catch(e){return!1}}()&&function(){var e=null,t=null,n=null,r=[1,2,3],o=function(o,i){return e=o,t=i,n=this,r};try{var i=f.apply(o,[null]),c=new i(1,2);return i.length===o.length&&c===r&&1===e&&2===t&&n!==r}catch(e){return!1}}(),l="".split,p=Math.max,y=o.bind,d=o.call,b=a?y.call(d,l):function(e,t){return l.call(e,t)},g=function(e){return c()(e)?b(e,""):e},h=function(e,t){var n=arguments.length>2?arguments[2]:[];if("string"!=typeof e&&o(e))return n;for(var r=u?e:g(e),i=r.length,c=p(0,t)||0;c<i;c+=1)n[n.length]=e[c];return n};function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,s=e[Symbol.iterator]();!(r=(c=s.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var v=h.bind,S=h.call,w={},j=w.constructor,O=w.toString,$=function(e,t){return e>=t?e:t},T=function(e){if("function"!=typeof e&&"[object Function]"!==O.apply(e))throw new TypeError("bind called on incompatible "+e)},x=[function(e){return function(){return e.apply(this,h(arguments))}},function(e,t){return function(n){return e.apply(this,h(arguments,t,[n]))}},function(e,t){return function(n,r){return e.apply(this,h(arguments,t,[n,r]))}},function(e,t){return function(n,r,o){return e.apply(this,h(arguments,t,[n,r,o]))}},function(e,t){return function(n,r,o,i){return e.apply(this,h(arguments,t,[n,r,o,i]))}},function(e,t){return function(n,r,o,i,c){return e.apply(this,h(arguments,t,[n,r,o,i,c]))}},function(e,t){return function(n,r,o,i,c,s){return e.apply(this,h(arguments,t,[n,r,o,i,c,s]))}},function(e,t){return function(n,r,o,i,c,s,u){return e.apply(this,h(arguments,t,[n,r,o,i,c,s,u]))}},function(e,t){return function(n,r,o,i,c,s,u,f){return e.apply(this,h(arguments,t,[n,r,o,i,c,s,u,f]))}}],F=function(e){var t=m(e,3),n=t[0],r=t[1],o=t[2],i=$(0,r.length-$(0,o.length-2)),c=x[i],s=c?c(n,i):x[0](n);if(r.prototype){var u=function(){};u.prototype=r.prototype,s.prototype=new u,u.prototype=null}return s},P=function(e,t){var n=e.apply(this,t);return j(n)===n?n:this},E=a?S.bind(v):function(e,t){T(e);var n,r=arguments,o=function(){var o=h(arguments,0,h(r,2));return this instanceof n?P.apply(this,[e,o]):e.apply(t,o)};return n=F([o,e,r])},_=TypeError,M=E.apply,k=E(E.call,M),C=E(M,{}.toString),N=function(e){if("function"!=typeof e&&"[object Function]"!==C(e))throw new _(e+" is not a function");return e},A=function(e,t){return k(N(e),t,h(arguments[2]))},I=function(e){try{return{threw:!1,value:A(e,this,h(arguments,1))}}catch(e){return{threw:!0,value:e}}},q=function(e){return!!e},D={}.toString,G=function(e){return function(e){if("function"!=typeof e&&"[object Function]"!==A(D,e))throw new TypeError("methodize called on incompatible "+e)}(e),function(){return A(e,arguments[0],h(arguments,1))}},L=G({}.toString),X=function(e){return null===e?"[object Null]":void 0===e?"[object Undefined]":L(e)},z=n(0),B=n.n(z);for(var H=I(function(){return function(e,t){if(e!==t)throw new TypeError("Cannot instantiate an arrow function")}(this,void 0),"function"==typeof Symbol&&B()(Symbol(""))}.bind(void 0)),R=!1===H.threw&&!0===H.value&&B()(Symbol.toStringTag),U=function(e){return null==e},V=function(e){if(U(e))throw new TypeError("Cannot call method on ".concat(e));return e},J="Cannot convert a Symbol value to a string".constructor,K=function(e){if(B()(e))throw new TypeError("Cannot convert a Symbol value to a string");return J(e)},Q=function(e){return K(V(e))},W=[{code:9,description:"Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\t"},{code:10,description:"Line Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\n"},{code:11,description:"Vertical Tab",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\v"},{code:12,description:"Form Feed",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\f"},{code:13,description:"Carriage Return",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\r"},{code:32,description:"Space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:160,description:"No-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:5760,description:"Ogham space mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:6158,description:"Mongolian vowel separator",es5:!0,es2015:!0,es2016:!0,es2017:!1,es2018:!1,string:""},{code:8192,description:"En quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8193,description:"Em quad",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8194,description:"En space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8195,description:"Em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8196,description:"Three-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8197,description:"Four-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8198,description:"Six-per-em space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8199,description:"Figure space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8200,description:"Punctuation space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8201,description:"Thin space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8202,description:"Hair space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8232,description:"Line separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2028"},{code:8233,description:"Paragraph separator",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\u2029"},{code:8239,description:"Narrow no-break space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:8287,description:"Medium mathematical space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:12288,description:"Ideographic space",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:" "},{code:65279,description:"Byte Order Mark",es5:!0,es2015:!0,es2016:!0,es2017:!0,es2018:!0,string:"\ufeff"}],Y="",Z=W.length,ee=0;ee<Z;ee+=1)W[ee].es2016&&W[ee].string,W[ee].es2018&&(Y+=W[ee].string);var te=Y,ne=new(0,/none/.constructor)("^[".concat(te,"]+")),re=G("".replace),oe=function(e){return re(Q(e),ne,"")},ie=new(0,/none/.constructor)("[".concat(te,"]+$")),ce=G("".replace),se=function(e){return ce(Q(e),ie,"")},ue=function(e){return oe(se(e))},fe=new(0,/none/.constructor)("[".concat(te,"]+"),"g"),ae=G(" ".replace),le=function(e){return ae(ue(e),fe," ")},pe=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,ye=G("".replace),de=function(e,t){return ye(Q(e),pe,arguments.length>1?K(t):"")},be=I.constructor,ge=G(I.toString),he=/^class /,me=G(he.test),ve=!1===I(function(){return be('"use strict"; return class My {};')()}).threw,Se=function(e){return me(he,le(de(ge(e)," ")))},we=function(e){var t=I(Se,e);return!1===t.threw&&t.value};t.default=function(e,t){return!o(e)&&(R?function(e,t){return!(ve&&!1===t&&we(e)||!1!==I(function(){return ge(e)}).threw)}(e,q(t)):(!ve||!1!==q(t)||!we(e))&&function(e){var t=X(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t}(e))}}])});
//# sourceMappingURL=is-function-x.min.js.map