slate-dev-logger
Version:
INTERNAL: A simple, development-only logger for Slate.
2 lines (1 loc) • 3.12 kB
JavaScript
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.SlateDevLogger={})}(this,function(e){"use strict";var n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}var o=t,i=r;function u(e){if(o===setTimeout)return setTimeout(e,0);if((o===t||!o)&&setTimeout)return o=setTimeout,setTimeout(e,0);try{return o(e,0)}catch(n){try{return o.call(null,e,0)}catch(n){return o.call(this,e,0)}}}"function"==typeof n.setTimeout&&(o=setTimeout),"function"==typeof n.clearTimeout&&(i=clearTimeout);var c,f=[],a=!1,l=-1;function s(){a&&c&&(a=!1,c.length?f=c.concat(f):l=-1,f.length&&p())}function p(){if(!a){var e=u(s);a=!0;for(var n=f.length;n;){for(c=f,f=[];++l<n;)c&&c[l].run();l=-1,n=f.length}c=null,a=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===r||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(n){try{return i.call(null,e)}catch(n){return i.call(this,e)}}}(e)}}function d(e,n){this.fun=e,this.array=n}d.prototype.run=function(){this.fun.apply(null,this.array)};function h(){}var v=h,w=h,y=h,m=h,g=h,T=h,b=h;var A=n.performance||{},D=A.now||A.mozNow||A.msNow||A.oNow||A.webkitNow||function(){return(new Date).getTime()};var E=new Date;var N={nextTick:function(e){var n=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)n[t-1]=arguments[t];f.push(new d(e,n)),1!==f.length||a||u(p)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:v,addListener:w,once:y,off:m,removeListener:g,removeAllListeners:T,emit:b,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var n=.001*D.call(A),t=Math.floor(n),r=Math.floor(n%1*1e9);return e&&(t-=e[0],(r-=e[1])<0&&(t--,r+=1e9)),[t,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-E)/1e3}},x=N&&N.env&&N.env.FORBID_DEPRECATIONS,I=N&&N.env&&N.env.FORBID_WARNINGS,L=void 0!==N&&N.env&&!1,O="undefined"!=typeof console&&"function"==typeof console.log&&"function"==typeof console.warn&&"function"==typeof console.error;function R(e,n){if(L&&O){for(var t,r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];(t=console)[e].apply(t,[n].concat(o))}}function _(e,n){throw new Error(n)}var k={deprecate:function(e,n){for(var t=x?_:R,r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];t.apply(void 0,["warn","Deprecation ("+e+"): "+n].concat(o))},error:function(e){if(O){for(var n,t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(n=console).error.apply(n,[e].concat(r))}},warn:function(e){for(var n=I?_:R,t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];n.apply(void 0,["warn","Warning: "+e].concat(r))}};e.default=k,Object.defineProperty(e,"__esModule",{value:!0})});