rxjs-tracer
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -1,20 +0,19 @@ | ||
function u(y){function H(){try{return z.apply(this,arguments)}catch(b){return A.f.e=b,A.f}}function B(b,a){b.index+=a;b.children&&(b.children=b.children.map(function(c){return B(c,a)}));return b}var g="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},l=function(b,a){return a={K:{}},b(a,a.K),a.K}(function(b,a){a.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof g&&g.global=== | ||
g&&g;if(!a.root)throw Error("RxJS could not find any global context (window, self, global)");}),v={B:function(b){return"function"===typeof b}},I={isArray:Array.isArray||function(b){return b&&"number"===typeof b.length}},m={f:{e:{}}},A=m,z,J=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},K={R:function(b){return null!=b&&"object"===typeof b}},C={N:function(b){z=b;return H}}, | ||
D=function(b){function a(a){b.call(this);this.P=a;a=Error.call(this,a?a.length+" errors occurred during unsubscription:\n "+a.map(function(a,c){return c+1+") "+a.toString()}).join("\n "):"");this.name=a.name="UnsubscriptionError";this.stack=a.stack;this.message=a.message}J(a,b);return a}(Error),n=function(){function b(a){this.closed=!1;a&&(this.H=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){this.closed=!0;var b=this.H,f=this.s;this.s=null;if(v.B(b)){var e=C.N(b).call(this); | ||
e===m.f&&(a=!0,(c=c||[]).push(m.f.e))}if(I.isArray(f))for(var b=-1,g=f.length;++b<g;)e=f[b],K.R(e)&&(e=C.N(e.unsubscribe).call(e),e===m.f&&(a=!0,c=c||[],e=m.f.e,e instanceof D?c=c.concat(e.P):c.push(e)));if(a)throw new D(c);}};b.prototype.add=function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":c.closed||"function"!==typeof c.unsubscribe||(this.closed?c.unsubscribe():(this.s||(this.s=[])).push(c));break;default:throw Error("unrecognized teardown "+ | ||
a+" added to Subscription.");}return c};b.prototype.remove=function(a){if(null!=a&&a!==this&&a!==b.EMPTY){var c=this.s;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))}};b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),w={closed:!0,next:function(){},error:function(b){throw b;},complete:function(){}},k=l.root.Symbol,r="function"===typeof k&&"function"===typeof k.for?k.for("rxSubscriber"):"@@rxSubscriber",E=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&& | ||
(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},p=function(b){function a(c,d,f){b.call(this);this.G=null;this.a=this.b=this.F=!1;switch(arguments.length){case 0:this.destination=w;break;case 1:if(!c){this.destination=w;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.b=!0,this.destination=new F(this,c));break}default:this.b=!0,this.destination=new F(this,c,d,f)}}E(a,b);a.prototype[r]=function(){return this};a.create= | ||
function(c,b,f){c=new a(c,b,f);c.b=!1;return c};a.prototype.next=function(a){this.a||this.i(a)};a.prototype.error=function(a){this.a||(this.a=!0,this.h(a))};a.prototype.complete=function(){this.a||(this.a=!0,this.g())};a.prototype.unsubscribe=function(){this.closed||(this.a=!0,b.prototype.unsubscribe.call(this))};a.prototype.i=function(a){this.destination.next(a)};a.prototype.h=function(a){this.destination.error(a);this.unsubscribe()};a.prototype.g=function(){this.destination.complete();this.unsubscribe()}; | ||
return a}(n),F=function(b){function a(a,d,f,e){b.call(this);this.j=a;var c;a=this;v.B(d)?c=d:d&&(a=d,c=d.next,f=d.error,e=d.complete,v.B(a.unsubscribe)&&this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this));this.A=a;this.i=c;this.h=f;this.g=e}E(a,b);a.prototype.next=function(a){if(!this.a&&this.i){var c=this.j;c.b?this.v(c,this.i,a)&&this.unsubscribe():this.w(this.i,a)}};a.prototype.error=function(a){if(!this.a){var c=this.j;if(this.h)c.b?this.v(c,this.h,a):this.w(this.h,a),this.unsubscribe(); | ||
else if(c.b)c.G=a,c.F=!0,this.unsubscribe();else throw this.unsubscribe(),a;}};a.prototype.complete=function(){if(!this.a){var a=this.j;this.g&&(a.b?this.v(a,this.g):this.w(this.g));this.unsubscribe()}};a.prototype.w=function(a,b){try{a.call(this.A,b)}catch(f){throw this.unsubscribe(),f;}};a.prototype.v=function(a,b,f){try{b.call(this.A,f)}catch(e){return a.G=e,a.F=!0}return!1};a.prototype.H=function(){var a=this.j;this.j=this.A=null;a.unsubscribe()};return a}(p),L=function(b){var a=b.Symbol;"function"=== | ||
typeof a?a.C?b=a.C:(b=a("observable"),a.C=b):b="@@observable";return b}(l.root),M={V:function(b,a,c){if(b){if(b instanceof p)return b;if(b[r])return b[r]()}return b||a||c?new p(b,a,c):new p(w)}},k=function(){function b(a){this.O=!1;a&&(this.o=a)}b.prototype.subscribe=function(a,b,d){var c=this.S;a=M.V(a,b,d);c?c.call(a,this):a.add(this.o(a));if(a.b&&(a.b=!1,a.F))throw a.G;return a};b.prototype.forEach=function(a,b){var c=this;b||(l.root.u&&l.root.u.J&&l.root.u.J.Promise?b=l.root.u.J.Promise:l.root.Promise&& | ||
(b=l.root.Promise));if(!b)throw Error("no Promise impl found");return new b(function(b,d){var e=c.subscribe(function(b){if(e)try{a(b)}catch(N){d(N),e.unsubscribe()}else a(b)},d,b)})};b.prototype.o=function(a){return this.source.subscribe(a)};b.prototype[L]=function(){return this};b.create=function(a){return new b(a)};return b}(),O=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}, | ||
t=function(b){function a(){var a=b.call(this,"object unsubscribed");this.name=a.name="ObjectUnsubscribedError";this.stack=a.stack;this.message=a.message}O(a,b);return a}(Error),P=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},Q=function(b){function a(a,d){b.call(this);this.l=a;this.U=d;this.closed=!1}P(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0; | ||
var a=this.l,b=a.c;this.l=null;!b||0===b.length||a.a||a.closed||(a=b.indexOf(this.U),-1!==a&&b.splice(a,1))}};return a}(n),x=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},R=function(b){function a(a){b.call(this,a);this.destination=a}x(a,b);return a}(p),q=function(b){function a(){b.call(this);this.c=[];this.L=this.a=this.closed=!1;this.M=null}x(a,b);a.prototype[r]=function(){return new R(this)}; | ||
a.prototype.next=function(a){if(this.closed)throw new t;if(!this.a)for(var b=this.c,c=b.length,b=b.slice(),e=0;e<c;e++)b[e].next(a)};a.prototype.error=function(a){if(this.closed)throw new t;this.L=!0;this.M=a;this.a=!0;for(var b=this.c,c=b.length,b=b.slice(),e=0;e<c;e++)b[e].error(a);this.c.length=0};a.prototype.complete=function(){if(this.closed)throw new t;this.a=!0;for(var a=this.c,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].complete();this.c.length=0};a.prototype.unsubscribe=function(){this.closed= | ||
this.a=!0;this.c=null};a.prototype.o=function(a){if(this.closed)throw new t;if(this.L)return a.error(this.M),n.EMPTY;if(this.a)return a.complete(),n.EMPTY;this.c.push(a);return new Q(this,a)};a.create=function(a,b){return new S(a,b)};return a}(k),S=function(b){function a(a,d){b.call(this);this.destination=a;this.source=d}x(a,b);a.prototype.next=function(a){var b=this.destination;b&&b.next&&b.next(a)};a.prototype.error=function(a){var b=this.destination;b&&b.error&&this.destination.error(a)};a.prototype.complete= | ||
function(){var a=this.destination;a&&a.complete&&this.destination.complete()};a.prototype.o=function(a){return this.source?this.source.subscribe(a):n.EMPTY};return a}(q),U=function(){function b(a,b){this.C=a;this.data=b}b.prototype.D=function(a){this.data.value=a;this.l&&(a=this.W.raw(),this.l.next(a))};return b}(),V=function(){function b(a,b,d){this.data=a;this.depth=b;this.index=d;this.children=[]}b.prototype.I=function(a){this.children.push(a)};b.prototype.value=function(){return this.children&& | ||
0<=this.children.length?1===this.children.length?this.data.value:this.children.map(function(a){return a.value()}):this.data.value};b.prototype.raw=function(){var a={id:this.id,depth:this.depth,index:this.index,value:this.value(),children:[]};this.children&&0<this.children.length&&(a.children=this.children.map(function(a){return a.raw()}));return a};return b}(),G=new q,q="undefined"===typeof global?window:global;q.Observable=k;q.RxTrackerData=G;var h={},W=0,k=k.prototype,X=k.subscribe;k.subscribe= | ||
function(b,a,c){var d=this.X,f=[].slice.call(arguments);if(b)if("function"===typeof b){var e=b;b=function(){h[d]&&h[d].D(arguments[0]);e.apply(this,arguments)};f[0]=b}else{if(0<b.constructor.name.indexOf("Subscriber")&&0>this.constructor.name.indexOf("Array")){var g=b.next;b.next=function(){h[d]&&h[d].D(arguments[0]);g.apply(b,arguments)}}}else f=[function(a){h[d]&&h[d].D(a)}];return X.apply(this,f)};y.Z=function(b,a){function c(a,b,f){"object"!==typeof a||a.__id||(a.__id="id"+W++);d=Math.min(d,f); | ||
var e;e=h[a.__id]?h[a.__id].data:{name:a.constructor.name.replace("Observable","$")};var g=new V(e,b,f);"object"===typeof a?(h[a.__id]||(h[a.__id]=new U(a,e)),g.id=a.__id):e.value=a;a.O&&(e.value=a.value);a.operator&&(e.S=a.operator.constructor.name.replace("Operator",""));a.source&&(e=c(a.source,b+1,f),g.I(e));a.array&&a.array.forEach(function(d,e){d=c(d,b+1,f+e+1-(a.array.length+1)/2);g.I(d);return d});return g}var d=0,f=c(b,0,1),d=-Math.min(d,0);a=a?B(f,d):f;h[b.__id].W=a;return h[b.__id].l=G}; | ||
Object.defineProperty(y,"__esModule",{value:!0})}"object"===typeof exports&&"undefined"!==typeof module?u(exports):"function"===typeof define&&define.Y?define(["exports"],u):u(this.T=this.T||{}); | ||
function u(z){function H(){try{return A.apply(this,arguments)}catch(b){return B.f.e=b,B.f}}function v(b){"object"!==typeof b||b.__id||(b.__id="id"+I++);var a;a=h[b.__id]?h[b.__id].data:{name:b.constructor.name.replace("Observable","$")};var c=new J(a);"object"===typeof b?(h[b.__id]||(h[b.__id]=new K(b,a)),c.id=b.__id):a.value=b;b.O&&(a.value=b.value);b.operator&&(a.S=b.operator.constructor.name.replace("Operator",""));b.source&&(a=v(b.source),c.I(a));b.array&&b.array.forEach(function(a){a=v(a);c.I(a); | ||
return a});return c}var g="undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},l=function(b,a){return a={K:{}},b(a,a.K),a.K}(function(b,a){a.root="object"==typeof window&&window.window===window&&window||"object"==typeof self&&self.self===self&&self||"object"==typeof g&&g.global===g&&g;if(!a.root)throw Error("RxJS could not find any global context (window, self, global)");}),w={B:function(b){return"function"===typeof b}},L={isArray:Array.isArray|| | ||
function(b){return b&&"number"===typeof b.length}},m={f:{e:{}}},B=m,A,M=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},N={R:function(b){return null!=b&&"object"===typeof b}},C={N:function(b){A=b;return H}},D=function(b){function a(a){b.call(this);this.P=a;a=Error.call(this,a?a.length+" errors occurred during unsubscription:\n "+a.map(function(a,c){return c+1+") "+a.toString()}).join("\n "): | ||
"");this.name=a.name="UnsubscriptionError";this.stack=a.stack;this.message=a.message}M(a,b);return a}(Error),n=function(){function b(a){this.closed=!1;a&&(this.H=a)}b.prototype.unsubscribe=function(){var a=!1,c;if(!this.closed){this.closed=!0;var b=this.H,f=this.s;this.s=null;if(w.B(b)){var e=C.N(b).call(this);e===m.f&&(a=!0,(c=c||[]).push(m.f.e))}if(L.isArray(f))for(var b=-1,g=f.length;++b<g;)e=f[b],N.R(e)&&(e=C.N(e.unsubscribe).call(e),e===m.f&&(a=!0,c=c||[],e=m.f.e,e instanceof D?c=c.concat(e.P): | ||
c.push(e)));if(a)throw new D(c);}};b.prototype.add=function(a){if(!a||a===b.EMPTY)return b.EMPTY;if(a===this)return this;var c=a;switch(typeof a){case "function":c=new b(a);case "object":c.closed||"function"!==typeof c.unsubscribe||(this.closed?c.unsubscribe():(this.s||(this.s=[])).push(c));break;default:throw Error("unrecognized teardown "+a+" added to Subscription.");}return c};b.prototype.remove=function(a){if(null!=a&&a!==this&&a!==b.EMPTY){var c=this.s;c&&(a=c.indexOf(a),-1!==a&&c.splice(a,1))}}; | ||
b.EMPTY=function(a){a.closed=!0;return a}(new b);return b}(),x={closed:!0,next:function(){},error:function(b){throw b;},complete:function(){}},k=l.root.Symbol,r="function"===typeof k&&"function"===typeof k.for?k.for("rxSubscriber"):"@@rxSubscriber",E=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},p=function(b){function a(c,d,f){b.call(this);this.G=null;this.a=this.b=this.F= | ||
!1;switch(arguments.length){case 0:this.destination=x;break;case 1:if(!c){this.destination=x;break}if("object"===typeof c){c instanceof a?(this.destination=c,this.destination.add(this)):(this.b=!0,this.destination=new F(this,c));break}default:this.b=!0,this.destination=new F(this,c,d,f)}}E(a,b);a.prototype[r]=function(){return this};a.create=function(c,b,f){c=new a(c,b,f);c.b=!1;return c};a.prototype.next=function(a){this.a||this.i(a)};a.prototype.error=function(a){this.a||(this.a=!0,this.h(a))}; | ||
a.prototype.complete=function(){this.a||(this.a=!0,this.g())};a.prototype.unsubscribe=function(){this.closed||(this.a=!0,b.prototype.unsubscribe.call(this))};a.prototype.i=function(a){this.destination.next(a)};a.prototype.h=function(a){this.destination.error(a);this.unsubscribe()};a.prototype.g=function(){this.destination.complete();this.unsubscribe()};return a}(n),F=function(b){function a(a,d,f,e){b.call(this);this.j=a;var c;a=this;w.B(d)?c=d:d&&(a=d,c=d.next,f=d.error,e=d.complete,w.B(a.unsubscribe)&& | ||
this.add(a.unsubscribe.bind(a)),a.unsubscribe=this.unsubscribe.bind(this));this.A=a;this.i=c;this.h=f;this.g=e}E(a,b);a.prototype.next=function(a){if(!this.a&&this.i){var b=this.j;b.b?this.v(b,this.i,a)&&this.unsubscribe():this.w(this.i,a)}};a.prototype.error=function(a){if(!this.a){var b=this.j;if(this.h)b.b?this.v(b,this.h,a):this.w(this.h,a),this.unsubscribe();else if(b.b)b.G=a,b.F=!0,this.unsubscribe();else throw this.unsubscribe(),a;}};a.prototype.complete=function(){if(!this.a){var a=this.j; | ||
this.g&&(a.b?this.v(a,this.g):this.w(this.g));this.unsubscribe()}};a.prototype.w=function(a,b){try{a.call(this.A,b)}catch(f){throw this.unsubscribe(),f;}};a.prototype.v=function(a,b,f){try{b.call(this.A,f)}catch(e){return a.G=e,a.F=!0}return!1};a.prototype.H=function(){var a=this.j;this.j=this.A=null;a.unsubscribe()};return a}(p),O=function(b){var a=b.Symbol;"function"===typeof a?a.C?b=a.C:(b=a("observable"),a.C=b):b="@@observable";return b}(l.root),P={V:function(b,a,c){if(b){if(b instanceof p)return b; | ||
if(b[r])return b[r]()}return b||a||c?new p(b,a,c):new p(x)}},k=function(){function b(a){this.O=!1;a&&(this.o=a)}b.prototype.subscribe=function(a,b,d){var c=this.S;a=P.V(a,b,d);c?c.call(a,this):a.add(this.o(a));if(a.b&&(a.b=!1,a.F))throw a.G;return a};b.prototype.forEach=function(a,b){var c=this;b||(l.root.u&&l.root.u.J&&l.root.u.J.Promise?b=l.root.u.J.Promise:l.root.Promise&&(b=l.root.Promise));if(!b)throw Error("no Promise impl found");return new b(function(b,d){var f=c.subscribe(function(b){if(f)try{a(b)}catch(Q){d(Q), | ||
f.unsubscribe()}else a(b)},d,b)})};b.prototype.o=function(a){return this.source.subscribe(a)};b.prototype[O]=function(){return this};b.create=function(a){return new b(a)};return b}(),R=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},t=function(b){function a(){var a=b.call(this,"object unsubscribed");this.name=a.name="ObjectUnsubscribedError";this.stack=a.stack;this.message= | ||
a.message}R(a,b);return a}(Error),S=g&&g.m||function(b,a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},U=function(b){function a(a,d){b.call(this);this.l=a;this.U=d;this.closed=!1}S(a,b);a.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var a=this.l,b=a.c;this.l=null;!b||0===b.length||a.a||a.closed||(a=b.indexOf(this.U),-1!==a&&b.splice(a,1))}};return a}(n),y=g&&g.m||function(b, | ||
a){function c(){this.constructor=b}for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d]);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)},V=function(b){function a(a){b.call(this,a);this.destination=a}y(a,b);return a}(p),q=function(b){function a(){b.call(this);this.c=[];this.L=this.a=this.closed=!1;this.M=null}y(a,b);a.prototype[r]=function(){return new V(this)};a.prototype.next=function(a){if(this.closed)throw new t;if(!this.a)for(var b=this.c,c=b.length,b=b.slice(),e=0;e<c;e++)b[e].next(a)}; | ||
a.prototype.error=function(a){if(this.closed)throw new t;this.L=!0;this.M=a;this.a=!0;for(var b=this.c,c=b.length,b=b.slice(),e=0;e<c;e++)b[e].error(a);this.c.length=0};a.prototype.complete=function(){if(this.closed)throw new t;this.a=!0;for(var a=this.c,b=a.length,a=a.slice(),f=0;f<b;f++)a[f].complete();this.c.length=0};a.prototype.unsubscribe=function(){this.closed=this.a=!0;this.c=null};a.prototype.o=function(a){if(this.closed)throw new t;if(this.L)return a.error(this.M),n.EMPTY;if(this.a)return a.complete(), | ||
n.EMPTY;this.c.push(a);return new U(this,a)};a.create=function(a,b){return new W(a,b)};return a}(k),W=function(b){function a(a,d){b.call(this);this.destination=a;this.source=d}y(a,b);a.prototype.next=function(a){var b=this.destination;b&&b.next&&b.next(a)};a.prototype.error=function(a){var b=this.destination;b&&b.error&&this.destination.error(a)};a.prototype.complete=function(){var a=this.destination;a&&a.complete&&this.destination.complete()};a.prototype.o=function(a){return this.source?this.source.subscribe(a): | ||
n.EMPTY};return a}(q),K=function(){function b(a,b){this.C=a;this.data=b}b.prototype.D=function(a){this.data.value=a;this.l&&(a=this.W.raw(),this.l.next(a))};return b}(),J=function(){function b(a){this.data=a;this.children=[]}b.prototype.I=function(a){this.children.push(a)};b.prototype.value=function(){return this.children&&0<=this.children.length?1===this.children.length?this.data.value:this.children.map(function(a){return a.value()}):this.data.value};b.prototype.raw=function(){var a={id:this.id, | ||
value:this.value()};this.children&&0<this.children.length&&(a.children=this.children.map(function(a){return a.raw()}));return a};return b}(),G=new q,q="undefined"===typeof global?window:global;q.Observable=k;q.RxTrackerData=G;var h={},I=0,k=k.prototype,X=k.subscribe;k.subscribe=function(b,a,c){var d=this.X,f=[].slice.call(arguments);if(b)if("function"===typeof b){var e=b;b=function(){h[d]&&h[d].D(arguments[0]);e.apply(this,arguments)};f[0]=b}else{if(0<b.constructor.name.indexOf("Subscriber")&&0>this.constructor.name.indexOf("Array")){var g= | ||
b.next;b.next=function(){h[d]&&h[d].D(arguments[0]);g.apply(b,arguments)}}}else f=[function(a){h[d]&&h[d].D(a)}];return X.apply(this,f)};z.Z=function(b){var a=v(b);h[b.__id].W=a;return h[b.__id].l=G};Object.defineProperty(z,"__esModule",{value:!0})}"object"===typeof exports&&"undefined"!==typeof module?u(exports):"function"===typeof define&&define.Y?define(["exports"],u):u(this.T=this.T||{}); |
@@ -978,6 +978,4 @@ (function (global, factory) { | ||
var TrackerTreeNode = (function () { | ||
function TrackerTreeNode(data, depth, index) { | ||
function TrackerTreeNode(data) { | ||
this.data = data; | ||
this.depth = depth; | ||
this.index = index; | ||
this.children = []; | ||
@@ -1004,6 +1002,3 @@ } | ||
id: this.id, | ||
depth: this.depth, | ||
index: this.index, | ||
value: this.value(), | ||
children: [] | ||
value: this.value() | ||
}; | ||
@@ -1074,64 +1069,50 @@ if (this.children && this.children.length > 0) { | ||
// 直接用缩放比例代入就可以展示成图形了,或者不用这些信息,只用层级结构展示成树也行 | ||
function traceRx(o, needMesure) { | ||
var max = 0; | ||
var min = 0; | ||
var root = trace(o, 0, 1); | ||
min = -Math.min(min, 0); | ||
var tree = needMesure ? mesure(root, min) : root; | ||
trackerMap[o['__id']].tree = tree; | ||
function traceRx(o) { | ||
var root = trace(o); | ||
trackerMap[o['__id']].tree = root; | ||
trackerMap[o['__id']].subject = subject$; | ||
return subject$; | ||
function trace(o, depth, index) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
function trace(o) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new TrackerTreeNode(result); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new Tracker(o, result); | ||
} | ||
max = Math.max(max, index); | ||
min = Math.min(min, index); | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new TrackerTreeNode(result, depth, index); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new Tracker(o, result); | ||
} | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source'], depth + 1, index); | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source']); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v, depth + 1, index + i + 1 - (o['array'].length + 1) / 2); | ||
node.addChild(child); | ||
return child; | ||
}); | ||
} | ||
return node; | ||
return child; | ||
}); | ||
} | ||
return node; | ||
} | ||
// 调整布局信息 | ||
function mesure(r, offset) { | ||
r.index += offset; | ||
if (r.children) { | ||
r.children = r.children.map(function (child) { return mesure(child, offset); }); | ||
} | ||
return r; | ||
} | ||
@@ -1138,0 +1119,0 @@ exports.traceRx = traceRx; |
import { Observable } from 'rxjs/Observable'; | ||
import { Subject } from 'rxjs/Subject'; | ||
export declare function traceRx(o: Observable<any>, needMesure?: boolean): Subject<any>; | ||
export declare function traceRx(o: Observable<any>): Subject<any>; |
@@ -59,65 +59,51 @@ "use strict"; | ||
// 直接用缩放比例代入就可以展示成图形了,或者不用这些信息,只用层级结构展示成树也行 | ||
function traceRx(o, needMesure) { | ||
var max = 0; | ||
var min = 0; | ||
var root = trace(o, 0, 1); | ||
min = -Math.min(min, 0); | ||
var tree = needMesure ? mesure(root, min) : root; | ||
trackerMap[o['__id']].tree = tree; | ||
function traceRx(o) { | ||
var root = trace(o); | ||
trackerMap[o['__id']].tree = root; | ||
trackerMap[o['__id']].subject = subject$; | ||
return subject$; | ||
function trace(o, depth, index) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
exports.traceRx = traceRx; | ||
function trace(o) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new tracker_node_1.TrackerTreeNode(result); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new tracker_1.Tracker(o, result); | ||
} | ||
max = Math.max(max, index); | ||
min = Math.min(min, index); | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new tracker_node_1.TrackerTreeNode(result, depth, index); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new tracker_1.Tracker(o, result); | ||
} | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source'], depth + 1, index); | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source']); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v, depth + 1, index + i + 1 - (o['array'].length + 1) / 2); | ||
node.addChild(child); | ||
return child; | ||
}); | ||
} | ||
return node; | ||
return child; | ||
}); | ||
} | ||
return node; | ||
} | ||
exports.traceRx = traceRx; | ||
// 调整布局信息 | ||
function mesure(r, offset) { | ||
r.index += offset; | ||
if (r.children) { | ||
r.children = r.children.map(function (child) { return mesure(child, offset); }); | ||
} | ||
return r; | ||
} | ||
//# sourceMappingURL=rx-tracer.js.map |
@@ -5,4 +5,2 @@ export interface TrackerTreeNodeData { | ||
value?: any; | ||
depth?: number; | ||
index?: number; | ||
operator?: string; | ||
@@ -14,6 +12,4 @@ children?: TrackerTreeNodeData[]; | ||
data: any; | ||
depth: number; | ||
index: number; | ||
children: TrackerTreeNode[]; | ||
constructor(data: any, depth: number, index: number); | ||
constructor(data: any); | ||
addChild(child: TrackerTreeNode): void; | ||
@@ -20,0 +16,0 @@ value(): any; |
@@ -8,6 +8,4 @@ "use strict"; | ||
var TrackerTreeNode = (function () { | ||
function TrackerTreeNode(data, depth, index) { | ||
function TrackerTreeNode(data) { | ||
this.data = data; | ||
this.depth = depth; | ||
this.index = index; | ||
this.children = []; | ||
@@ -34,6 +32,3 @@ } | ||
id: this.id, | ||
depth: this.depth, | ||
index: this.index, | ||
value: this.value(), | ||
children: [] | ||
value: this.value() | ||
}; | ||
@@ -40,0 +35,0 @@ if (this.children && this.children.length > 0) { |
import { Observable } from 'rxjs/Observable'; | ||
import { Subject } from 'rxjs/Subject'; | ||
export declare function traceRx(o: Observable<any>, needMesure?: boolean): Subject<any>; | ||
export declare function traceRx(o: Observable<any>): Subject<any>; |
@@ -58,64 +58,50 @@ import { Observable } from 'rxjs/Observable'; | ||
// 直接用缩放比例代入就可以展示成图形了,或者不用这些信息,只用层级结构展示成树也行 | ||
export function traceRx(o, needMesure) { | ||
var max = 0; | ||
var min = 0; | ||
var root = trace(o, 0, 1); | ||
min = -Math.min(min, 0); | ||
var tree = needMesure ? mesure(root, min) : root; | ||
trackerMap[o['__id']].tree = tree; | ||
export function traceRx(o) { | ||
var root = trace(o); | ||
trackerMap[o['__id']].tree = root; | ||
trackerMap[o['__id']].subject = subject$; | ||
return subject$; | ||
function trace(o, depth, index) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
function trace(o) { | ||
if (typeof o === 'object' && !o['__id']) { | ||
o['__id'] = getId(); | ||
} | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new TrackerTreeNode(result); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new Tracker(o, result); | ||
} | ||
max = Math.max(max, index); | ||
min = Math.min(min, index); | ||
var result; | ||
if (trackerMap[o['__id']]) { | ||
result = trackerMap[o['__id']].data; | ||
} | ||
else { | ||
result = { | ||
name: o.constructor.name.replace('Observable', '$') | ||
}; | ||
} | ||
var node = new TrackerTreeNode(result, depth, index); | ||
if (typeof o === 'object') { | ||
if (!trackerMap[o['__id']]) { | ||
trackerMap[o['__id']] = new Tracker(o, result); | ||
} | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source'], depth + 1, index); | ||
node.id = o['__id']; | ||
} | ||
else { | ||
result.value = o; | ||
} | ||
if (o._isScalar) { | ||
result.value = o['value']; | ||
} | ||
if (o['operator']) { | ||
result.operator = o['operator'].constructor.name.replace('Operator', ''); | ||
} | ||
if (o['source']) { | ||
var child = trace(o['source']); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v); | ||
node.addChild(child); | ||
} | ||
if (o['array']) { | ||
o['array'].forEach(function (v, i) { | ||
var child = trace(v, depth + 1, index + i + 1 - (o['array'].length + 1) / 2); | ||
node.addChild(child); | ||
return child; | ||
}); | ||
} | ||
return node; | ||
return child; | ||
}); | ||
} | ||
return node; | ||
} | ||
// 调整布局信息 | ||
function mesure(r, offset) { | ||
r.index += offset; | ||
if (r.children) { | ||
r.children = r.children.map(function (child) { return mesure(child, offset); }); | ||
} | ||
return r; | ||
} | ||
//# sourceMappingURL=rx-tracer.js.map |
@@ -5,4 +5,2 @@ export interface TrackerTreeNodeData { | ||
value?: any; | ||
depth?: number; | ||
index?: number; | ||
operator?: string; | ||
@@ -14,6 +12,4 @@ children?: TrackerTreeNodeData[]; | ||
data: any; | ||
depth: number; | ||
index: number; | ||
children: TrackerTreeNode[]; | ||
constructor(data: any, depth: number, index: number); | ||
constructor(data: any); | ||
addChild(child: TrackerTreeNode): void; | ||
@@ -20,0 +16,0 @@ value(): any; |
@@ -7,6 +7,4 @@ // TracerTreeNode 是用来提供给跟踪图形的一个结构 | ||
export var TrackerTreeNode = (function () { | ||
function TrackerTreeNode(data, depth, index) { | ||
function TrackerTreeNode(data) { | ||
this.data = data; | ||
this.depth = depth; | ||
this.index = index; | ||
this.children = []; | ||
@@ -33,6 +31,3 @@ } | ||
id: this.id, | ||
depth: this.depth, | ||
index: this.index, | ||
value: this.value(), | ||
children: [] | ||
value: this.value() | ||
}; | ||
@@ -39,0 +34,0 @@ if (this.children && this.children.length > 0) { |
{ | ||
"name": "rxjs-tracer", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "A simple RxJS data tracer", | ||
@@ -15,3 +15,3 @@ "author": "xufei <xu.fei@outlook.com>", | ||
"lint": "tslint ./src/**/*.ts ./test/unit/**/*.ts", | ||
"publish": "npm run build_all" | ||
"publish": "npm run build_all && npm publish" | ||
}, | ||
@@ -18,0 +18,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114784
1514