redux-logger
Advanced tools
Comparing version 2.7.1 to 2.7.2
@@ -252,3 +252,11 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
return function (action, time, took) { | ||
return 'action @ ' + (timestamp ? time : '') + ' ' + action.type + ' ' + (duration ? '(in ' + took.toFixed(2) + ' ms)' : ''); | ||
var parts = ['action']; | ||
if (timestamp) { | ||
parts.push('@ ' + time); | ||
} | ||
parts.push(action.type); | ||
if (duration) { | ||
parts.push('(in ' + took.toFixed(2) + ' ms)'); | ||
} | ||
return parts.join(' '); | ||
}; | ||
@@ -255,0 +263,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.reduxLogger=t():e.reduxLogger=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){r(2),e.exports=r(2)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.repeat=function(e,t){return new Array(t+1).join(e)},n=t.pad=function(e,t){return r("0",t-e.toString().length)+e};t.formatTime=function(e){return n(e.getHours(),2)+":"+n(e.getMinutes(),2)+":"+n(e.getSeconds(),2)+"."+n(e.getMilliseconds(),3)},t.timer="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=i({},c["default"],e),r=t.logger,n=t.transformer,o=t.stateTransformer,f=t.errorTransformer,l=t.predicate,s=t.logErrors,p=t.diffPredicate;if("undefined"==typeof r)return function(){return function(e){return function(t){return e(t)}}};n&&console.error("Option 'transformer' is deprecated, use 'stateTransformer' instead!");var d=[];return function(e){var r=e.getState;return function(e){return function(n){if("function"==typeof l&&!l(r,n))return e(n);var c={};d.push(c),c.started=u.timer.now(),c.startedTime=new Date,c.prevState=o(r()),c.action=n;var h=void 0;if(s)try{h=e(n)}catch(v){c.error=f(v)}else h=e(n);c.took=u.timer.now()-c.started,c.nextState=o(r());var g=t.diff&&"function"==typeof p?p(r,n):t.diff;if((0,a.printBuffer)(d,i({},t,{diff:g})),d.length=0,c.error)throw c.error;return h}}}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(3),u=r(1),f=r(4),c=n(f);t["default"]=o,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function a(e,t,r,n){switch("undefined"==typeof e?"undefined":i(e)){case"object":return"function"==typeof e[n]?e[n].apply(e,o(r)):e[n];case"function":return e(t);default:return e}}function u(e){var t=e.timestamp,r=e.duration;return function(e,n,o){return"action @ "+(t?n:"")+" "+e.type+" "+(r?"(in "+o.toFixed(2)+" ms)":"")}}function f(e,t){var r=t.logger,n=t.actionTransformer,o=t.titleFormatter,i=void 0===o?u(t):o,f=t.collapsed,l=t.colors,p=t.level,d=t.diff;e.forEach(function(t,o){var u=t.started,h=t.startedTime,v=t.action,g=t.prevState,b=t.error,y=t.took,m=t.nextState,x=e[o+1];x&&(m=x.prevState,y=x.started-u);var j=n(v),w="function"==typeof f?f(function(){return m},v):f,k=(0,c.formatTime)(h),D=l.title?"color: "+l.title(j)+";":null,E=i(j,k,y);try{w?l.title?r.groupCollapsed("%c "+E,D):r.groupCollapsed(E):l.title?r.group("%c "+E,D):r.group(E)}catch(O){r.log(E)}var A=a(p,j,[g],"prevState"),S=a(p,j,[j],"action"),_=a(p,j,[b,g],"error"),P=a(p,j,[m],"nextState");A&&(l.prevState?r[A]("%c prev state","color: "+l.prevState(g)+"; font-weight: bold",g):r[A]("prev state",g)),S&&(l.action?r[S]("%c action","color: "+l.action(j)+"; font-weight: bold",j):r[S]("action",j)),b&&_&&(l.error?r[_]("%c error","color: "+l.error(b,g)+"; font-weight: bold",b):r[_]("error",b)),P&&(l.nextState?r[P]("%c next state","color: "+l.nextState(m)+"; font-weight: bold",m):r[P]("next state",m)),d&&(0,s["default"])(g,m,r,w);try{r.groupEnd()}catch(O){r.log("—— log end ——")}})}Object.defineProperty(t,"__esModule",{value:!0}),t.printBuffer=f;var c=r(1),l=r(5),s=n(l)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={level:"log",logger:window&&window.console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"color: "+c[e].color+"; font-weight: bold"}function i(e){var t=e.kind,r=e.path,n=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case"E":return r.join(".")+" "+n+" → "+o;case"N":return r.join(".")+" "+o;case"D":return""+r.join(".");case"A":return[r.join(".")+"["+i+"]",a];default:return null}}function a(e,t,r,n){var a=(0,f["default"])(e,t);try{n?r.groupCollapsed("diff"):r.group("diff")}catch(u){r.log("diff")}a?a.forEach(function(e){var t=e.kind,n=i(e);r.log("%c "+c[t].text,o(t),n)}):r.log("—— no diff ——");try{r.groupEnd()}catch(u){r.log("—— diff end —— ")}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=a;var u=r(6),f=n(u),c={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}};e.exports=t["default"]},function(e,t,r){var n,o;(function(r){!function(r,i){"use strict";n=[],o=function(){return i()}.apply(t,n),!(void 0!==o&&(e.exports=o))}(this,function(e){"use strict";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function o(e,t,r){o.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:r,enumerable:!0})}function i(e,t){i.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function a(e,t){a.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function u(e,t,r){u.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,n),e}function c(e){var t=typeof e;return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"undefined"!=typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(t,r,n,s,p,d,h){p=p||[];var v=p.slice(0);if("undefined"!=typeof d){if(s){if("function"==typeof s&&s(v,d))return;if("object"==typeof s){if(s.prefilter&&s.prefilter(v,d))return;if(s.normalize){var g=s.normalize(v,d,t,r);g&&(t=g[0],r=g[1])}}}v.push(d)}"regexp"===c(t)&&"regexp"===c(r)&&(t=t.toString(),r=r.toString());var b=typeof t,y=typeof r;if("undefined"===b)"undefined"!==y&&n(new i(v,r));else if("undefined"===y)n(new a(v,t));else if(c(t)!==c(r))n(new o(v,t,r));else if("[object Date]"===Object.prototype.toString.call(t)&&"[object Date]"===Object.prototype.toString.call(r)&&t-r!==0)n(new o(v,t,r));else if("object"===b&&null!==t&&null!==r){if(h=h||[],h.indexOf(t)<0){if(h.push(t),Array.isArray(t)){var m;t.length;for(m=0;m<t.length;m++)m>=r.length?n(new u(v,m,new a(e,t[m]))):l(t[m],r[m],n,s,v,m,h);for(;m<r.length;)n(new u(v,m,new i(e,r[m++])))}else{var x=Object.keys(t),j=Object.keys(r);x.forEach(function(o,i){var a=j.indexOf(o);a>=0?(l(t[o],r[o],n,s,v,o,h),j=f(j,a)):l(t[o],e,n,s,v,o,h)}),j.forEach(function(t){l(e,r[t],n,s,v,t,h)})}h.length=h.length-1}}else t!==r&&("number"===b&&isNaN(t)&&isNaN(r)||n(new o(v,t,r)))}function s(t,r,n,o){return o=o||[],l(t,r,function(e){e&&o.push(e)},n),o.length?o:e}function p(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;i>n;n++)o=o[r.path[n]];switch(r.kind){case"A":p(o[r.path[n]],r.index,r.item);break;case"D":delete o[r.path[n]];break;case"E":case"N":o[r.path[n]]=r.rhs}}else switch(r.kind){case"A":p(e[t],r.index,r.item);break;case"D":e=f(e,t);break;case"E":case"N":e[t]=r.rhs}return e}function d(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o<i;)"undefined"==typeof n[r.path[o]]&&(n[r.path[o]]="number"==typeof r.path[o]?[]:{}),n=n[r.path[o]];switch(r.kind){case"A":p(r.path?n[r.path[o]]:n,r.index,r.item);break;case"D":delete n[r.path[o]];break;case"E":case"N":n[r.path[o]]=r.rhs}}}function h(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;i>n;n++)o=o[r.path[n]];switch(r.kind){case"A":h(o[r.path[n]],r.index,r.item);break;case"D":o[r.path[n]]=r.lhs;break;case"E":o[r.path[n]]=r.lhs;break;case"N":delete o[r.path[n]]}}else switch(r.kind){case"A":h(e[t],r.index,r.item);break;case"D":e[t]=r.lhs;break;case"E":e[t]=r.lhs;break;case"N":e=f(e,t)}return e}function v(e,t,r){if(e&&t&&r&&r.kind){var n,o,i=e;for(o=r.path.length-1,n=0;o>n;n++)"undefined"==typeof i[r.path[n]]&&(i[r.path[n]]={}),i=i[r.path[n]];switch(r.kind){case"A":h(i[r.path[n]],r.index,r.item);break;case"D":i[r.path[n]]=r.lhs;break;case"E":i[r.path[n]]=r.lhs;break;case"N":delete i[r.path[n]]}}}function g(e,t,r){if(e&&t){var n=function(n){(!r||r(e,t,n))&&d(e,t,n)};l(e,t,n)}}var b,y,m=[];return b="object"==typeof r&&r?r:"undefined"!=typeof window?window:{},y=b.DeepDiff,y&&m.push(function(){"undefined"!=typeof y&&b.DeepDiff===s&&(b.DeepDiff=y,y=e)}),t(o,n),t(i,n),t(a,n),t(u,n),Object.defineProperties(s,{diff:{value:s,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:g,enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:v,enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof y},enumerable:!0},noConflict:{value:function(){return m&&(m.forEach(function(e){e()}),m=null),s},enumerable:!0}}),s})}).call(t,function(){return this}())}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.reduxLogger=t():e.reduxLogger=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){r(2),e.exports=r(2)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.repeat=function(e,t){return new Array(t+1).join(e)},n=t.pad=function(e,t){return r("0",t-e.toString().length)+e};t.formatTime=function(e){return n(e.getHours(),2)+":"+n(e.getMinutes(),2)+":"+n(e.getSeconds(),2)+"."+n(e.getMilliseconds(),3)},t.timer="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=i({},c["default"],e),r=t.logger,n=t.transformer,o=t.stateTransformer,f=t.errorTransformer,l=t.predicate,s=t.logErrors,p=t.diffPredicate;if("undefined"==typeof r)return function(){return function(e){return function(t){return e(t)}}};n&&console.error("Option 'transformer' is deprecated, use 'stateTransformer' instead!");var d=[];return function(e){var r=e.getState;return function(e){return function(n){if("function"==typeof l&&!l(r,n))return e(n);var c={};d.push(c),c.started=u.timer.now(),c.startedTime=new Date,c.prevState=o(r()),c.action=n;var h=void 0;if(s)try{h=e(n)}catch(v){c.error=f(v)}else h=e(n);c.took=u.timer.now()-c.started,c.nextState=o(r());var g=t.diff&&"function"==typeof p?p(r,n):t.diff;if((0,a.printBuffer)(d,i({},t,{diff:g})),d.length=0,c.error)throw c.error;return h}}}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};Object.defineProperty(t,"__esModule",{value:!0});var a=r(3),u=r(1),f=r(4),c=n(f);t["default"]=o,e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function i(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function a(e,t,r,n){switch("undefined"==typeof e?"undefined":i(e)){case"object":return"function"==typeof e[n]?e[n].apply(e,o(r)):e[n];case"function":return e(t);default:return e}}function u(e){var t=e.timestamp,r=e.duration;return function(e,n,o){var i=["action"];return t&&i.push("@ "+n),i.push(e.type),r&&i.push("(in "+o.toFixed(2)+" ms)"),i.join(" ")}}function f(e,t){var r=t.logger,n=t.actionTransformer,o=t.titleFormatter,i=void 0===o?u(t):o,f=t.collapsed,l=t.colors,p=t.level,d=t.diff;e.forEach(function(t,o){var u=t.started,h=t.startedTime,v=t.action,g=t.prevState,b=t.error,y=t.took,m=t.nextState,x=e[o+1];x&&(m=x.prevState,y=x.started-u);var j=n(v),w="function"==typeof f?f(function(){return m},v):f,k=(0,c.formatTime)(h),D=l.title?"color: "+l.title(j)+";":null,E=i(j,k,y);try{w?l.title?r.groupCollapsed("%c "+E,D):r.groupCollapsed(E):l.title?r.group("%c "+E,D):r.group(E)}catch(O){r.log(E)}var A=a(p,j,[g],"prevState"),S=a(p,j,[j],"action"),_=a(p,j,[b,g],"error"),P=a(p,j,[m],"nextState");A&&(l.prevState?r[A]("%c prev state","color: "+l.prevState(g)+"; font-weight: bold",g):r[A]("prev state",g)),S&&(l.action?r[S]("%c action","color: "+l.action(j)+"; font-weight: bold",j):r[S]("action",j)),b&&_&&(l.error?r[_]("%c error","color: "+l.error(b,g)+"; font-weight: bold",b):r[_]("error",b)),P&&(l.nextState?r[P]("%c next state","color: "+l.nextState(m)+"; font-weight: bold",m):r[P]("next state",m)),d&&(0,s["default"])(g,m,r,w);try{r.groupEnd()}catch(O){r.log("—— log end ——")}})}Object.defineProperty(t,"__esModule",{value:!0}),t.printBuffer=f;var c=r(1),l=r(5),s=n(l)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]={level:"log",logger:window&&window.console,logErrors:!0,collapsed:void 0,predicate:void 0,duration:!1,timestamp:!0,stateTransformer:function(e){return e},actionTransformer:function(e){return e},errorTransformer:function(e){return e},colors:{title:function(){return"inherit"},prevState:function(){return"#9E9E9E"},action:function(){return"#03A9F4"},nextState:function(){return"#4CAF50"},error:function(){return"#F20404"}},diff:!1,diffPredicate:void 0,transformer:void 0},e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){return"color: "+c[e].color+"; font-weight: bold"}function i(e){var t=e.kind,r=e.path,n=e.lhs,o=e.rhs,i=e.index,a=e.item;switch(t){case"E":return r.join(".")+" "+n+" → "+o;case"N":return r.join(".")+" "+o;case"D":return""+r.join(".");case"A":return[r.join(".")+"["+i+"]",a];default:return null}}function a(e,t,r,n){var a=(0,f["default"])(e,t);try{n?r.groupCollapsed("diff"):r.group("diff")}catch(u){r.log("diff")}a?a.forEach(function(e){var t=e.kind,n=i(e);r.log("%c "+c[t].text,o(t),n)}):r.log("—— no diff ——");try{r.groupEnd()}catch(u){r.log("—— diff end —— ")}}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=a;var u=r(6),f=n(u),c={E:{color:"#2196F3",text:"CHANGED:"},N:{color:"#4CAF50",text:"ADDED:"},D:{color:"#F44336",text:"DELETED:"},A:{color:"#2196F3",text:"ARRAY:"}};e.exports=t["default"]},function(e,t,r){var n,o;(function(r){!function(r,i){"use strict";n=[],o=function(){return i()}.apply(t,n),!(void 0!==o&&(e.exports=o))}(this,function(e){"use strict";function t(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}function n(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:!0}),t&&t.length&&Object.defineProperty(this,"path",{value:t,enumerable:!0})}function o(e,t,r){o.super_.call(this,"E",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0}),Object.defineProperty(this,"rhs",{value:r,enumerable:!0})}function i(e,t){i.super_.call(this,"N",e),Object.defineProperty(this,"rhs",{value:t,enumerable:!0})}function a(e,t){a.super_.call(this,"D",e),Object.defineProperty(this,"lhs",{value:t,enumerable:!0})}function u(e,t,r){u.super_.call(this,"A",e),Object.defineProperty(this,"index",{value:t,enumerable:!0}),Object.defineProperty(this,"item",{value:r,enumerable:!0})}function f(e,t,r){var n=e.slice((r||t)+1||e.length);return e.length=0>t?e.length+t:t,e.push.apply(e,n),e}function c(e){var t=typeof e;return"object"!==t?t:e===Math?"math":null===e?"null":Array.isArray(e)?"array":"[object Date]"===Object.prototype.toString.call(e)?"date":"undefined"!=typeof e.toString&&/^\/.*\//.test(e.toString())?"regexp":"object"}function l(t,r,n,s,p,d,h){p=p||[];var v=p.slice(0);if("undefined"!=typeof d){if(s){if("function"==typeof s&&s(v,d))return;if("object"==typeof s){if(s.prefilter&&s.prefilter(v,d))return;if(s.normalize){var g=s.normalize(v,d,t,r);g&&(t=g[0],r=g[1])}}}v.push(d)}"regexp"===c(t)&&"regexp"===c(r)&&(t=t.toString(),r=r.toString());var b=typeof t,y=typeof r;if("undefined"===b)"undefined"!==y&&n(new i(v,r));else if("undefined"===y)n(new a(v,t));else if(c(t)!==c(r))n(new o(v,t,r));else if("[object Date]"===Object.prototype.toString.call(t)&&"[object Date]"===Object.prototype.toString.call(r)&&t-r!==0)n(new o(v,t,r));else if("object"===b&&null!==t&&null!==r){if(h=h||[],h.indexOf(t)<0){if(h.push(t),Array.isArray(t)){var m;t.length;for(m=0;m<t.length;m++)m>=r.length?n(new u(v,m,new a(e,t[m]))):l(t[m],r[m],n,s,v,m,h);for(;m<r.length;)n(new u(v,m,new i(e,r[m++])))}else{var x=Object.keys(t),j=Object.keys(r);x.forEach(function(o,i){var a=j.indexOf(o);a>=0?(l(t[o],r[o],n,s,v,o,h),j=f(j,a)):l(t[o],e,n,s,v,o,h)}),j.forEach(function(t){l(e,r[t],n,s,v,t,h)})}h.length=h.length-1}}else t!==r&&("number"===b&&isNaN(t)&&isNaN(r)||n(new o(v,t,r)))}function s(t,r,n,o){return o=o||[],l(t,r,function(e){e&&o.push(e)},n),o.length?o:e}function p(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;i>n;n++)o=o[r.path[n]];switch(r.kind){case"A":p(o[r.path[n]],r.index,r.item);break;case"D":delete o[r.path[n]];break;case"E":case"N":o[r.path[n]]=r.rhs}}else switch(r.kind){case"A":p(e[t],r.index,r.item);break;case"D":e=f(e,t);break;case"E":case"N":e[t]=r.rhs}return e}function d(e,t,r){if(e&&t&&r&&r.kind){for(var n=e,o=-1,i=r.path?r.path.length-1:0;++o<i;)"undefined"==typeof n[r.path[o]]&&(n[r.path[o]]="number"==typeof r.path[o]?[]:{}),n=n[r.path[o]];switch(r.kind){case"A":p(r.path?n[r.path[o]]:n,r.index,r.item);break;case"D":delete n[r.path[o]];break;case"E":case"N":n[r.path[o]]=r.rhs}}}function h(e,t,r){if(r.path&&r.path.length){var n,o=e[t],i=r.path.length-1;for(n=0;i>n;n++)o=o[r.path[n]];switch(r.kind){case"A":h(o[r.path[n]],r.index,r.item);break;case"D":o[r.path[n]]=r.lhs;break;case"E":o[r.path[n]]=r.lhs;break;case"N":delete o[r.path[n]]}}else switch(r.kind){case"A":h(e[t],r.index,r.item);break;case"D":e[t]=r.lhs;break;case"E":e[t]=r.lhs;break;case"N":e=f(e,t)}return e}function v(e,t,r){if(e&&t&&r&&r.kind){var n,o,i=e;for(o=r.path.length-1,n=0;o>n;n++)"undefined"==typeof i[r.path[n]]&&(i[r.path[n]]={}),i=i[r.path[n]];switch(r.kind){case"A":h(i[r.path[n]],r.index,r.item);break;case"D":i[r.path[n]]=r.lhs;break;case"E":i[r.path[n]]=r.lhs;break;case"N":delete i[r.path[n]]}}}function g(e,t,r){if(e&&t){var n=function(n){(!r||r(e,t,n))&&d(e,t,n)};l(e,t,n)}}var b,y,m=[];return b="object"==typeof r&&r?r:"undefined"!=typeof window?window:{},y=b.DeepDiff,y&&m.push(function(){"undefined"!=typeof y&&b.DeepDiff===s&&(b.DeepDiff=y,y=e)}),t(o,n),t(i,n),t(a,n),t(u,n),Object.defineProperties(s,{diff:{value:s,enumerable:!0},observableDiff:{value:l,enumerable:!0},applyDiff:{value:g,enumerable:!0},applyChange:{value:d,enumerable:!0},revertChange:{value:v,enumerable:!0},isConflict:{value:function(){return"undefined"!=typeof y},enumerable:!0},noConflict:{value:function(){return m&&(m.forEach(function(e){e()}),m=null),s},enumerable:!0}}),s})}).call(t,function(){return this}())}])}); |
@@ -46,3 +46,11 @@ 'use strict'; | ||
return function (action, time, took) { | ||
return 'action @ ' + (timestamp ? time : '') + ' ' + action.type + ' ' + (duration ? '(in ' + took.toFixed(2) + ' ms)' : ''); | ||
var parts = ['action']; | ||
if (timestamp) { | ||
parts.push('@ ' + time); | ||
} | ||
parts.push(action.type); | ||
if (duration) { | ||
parts.push('(in ' + took.toFixed(2) + ' ms)'); | ||
} | ||
return parts.join(' '); | ||
}; | ||
@@ -49,0 +57,0 @@ } |
{ | ||
"name": "redux-logger", | ||
"version": "2.7.1", | ||
"version": "2.7.2", | ||
"description": "Logger for Redux", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -30,4 +30,13 @@ import { formatTime } from './helpers'; | ||
return (action, time, took) => | ||
`action @ ${timestamp ? time : ``} ${action.type} ${duration ? `(in ${took.toFixed(2)} ms)` : ``}`; | ||
return (action, time, took) => { | ||
const parts = [`action`]; | ||
if (timestamp) { | ||
parts.push(`@ ${time}`); | ||
} | ||
parts.push(action.type); | ||
if (duration) { | ||
parts.push(`(in ${took.toFixed(2)} ms)`); | ||
} | ||
return parts.join(` `); | ||
}; | ||
} | ||
@@ -34,0 +43,0 @@ |
71419
1404