Comparing version 0.2.1 to 0.3.0
@@ -117,8 +117,16 @@ 'use strict'; | ||
return function () { | ||
mainSub.unsubscribe(); | ||
childSetSubs.forEach(function (sub) { | ||
sub.unsubscribe(); | ||
}); | ||
childSets.clear(); | ||
return { | ||
unsubscribe: function unsubscribe() { | ||
mainSub.unsubscribe(); | ||
childSetSubs.forEach(function (sub) { | ||
sub.unsubscribe(); | ||
}); | ||
childSets.clear(); | ||
}, | ||
pullChanges: function pullChanges() { | ||
mainSub.pullChanges(); | ||
childSetSubs.forEach(function (sub) { | ||
sub.pullChanges(); | ||
}); | ||
} | ||
}; | ||
@@ -130,2 +138,2 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mbGF0TWFwLmpzIl0sIm5hbWVzIjpbImZsYXRNYXAiLCJsaXZlU2V0IiwiY2IiLCJyZWFkIiwicyIsInZhbHVlcyIsImZvckVhY2giLCJjaGlsZFNldCIsInZhbHVlIiwiYWRkIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsIm1haW5TdWJDb21wbGV0ZWQiLCJjaGlsZFNldFN1YnMiLCJjaGlsZFNldFN1YnNjcmliZSIsInN1YnNjcmliZSIsInN0YXJ0Iiwic3ViIiwic2V0IiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwicmVtb3ZlIiwiZXJyb3IiLCJlcnIiLCJjb21wbGV0ZSIsImRlbGV0ZSIsImNoaWxkU2V0cyIsInNpemUiLCJlbmQiLCJtYWluU3ViIiwiZ2V0IiwiRXJyb3IiLCJjaGlsZFNldFN1YiIsInVuc3Vic2NyaWJlIiwiaW5pdGlhbFZhbHVlcyIsImNsZWFyIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztrQkFLd0JBLE87O0FBSHhCOzs7Ozs7QUFHZSxTQUFTQSxPQUFULENBQXNCQyxPQUF0QixFQUEy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0U3ViczogTWFwPExpdmVTZXQ8VT4sIExpdmVTZXRTdWJzY3JpcHRpb24+ID0gbmV3IE1hcCgpO1xuXG4gICAgICBmdW5jdGlvbiBjaGlsZFNldFN1YnNjcmliZShjaGlsZFNldDogTGl2ZVNldDxVPiwgdmFsdWU6IFQpIHtcbiAgICAgICAgY2hpbGRTZXQuc3Vic2NyaWJlKHtcbiAgICAgICAgICBzdGFydChzdWIpIHtcbiAgICAgICAgICAgIGNoaWxkU2V0U3Vicy5zZXQoY2hpbGRTZXQsIHN1Yik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgICBjaGlsZFNldFN1YnMuZGVsZXRlKGNoaWxkU2V0KTtcbiAgICAgICAgICAgIGNoaWxkU2V0cy5kZWxldGUodmFsdWUpO1xuICAgICAgICAgICAgaWYgKG1haW5TdWJDb21wbGV0ZWQgJiYgY2hpbGRTZXRTdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICA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ICAgICAgICBjb250cm9sbGVyLnJlbW92ZSh2YWx1ZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBjaGlsZFNldFN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICBjaGlsZFNldFN1YnMuZGVsZXRlKGNoaWxkU2V0KTtcbiAgICAgICAgICAgICAgY2hpbGRTZXRzLmRlbGV0ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgIG1haW5TdWJDb21wbGV0ZWQgPSB0cnVlO1xuICAgICAgICAgIGlmIChjaGlsZFNldFN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBjb25zdCBjaGlsZFNldHM6IE1hcDxULCBMaXZlU2V0PFU+PiA9IG5ldyBNYXAoKTtcbiAgICAgIHtcbiAgICAgICAgY29uc3QgaW5pdGlhbFZhbHVlcyA9IG5ldyBTZXQoKTtcbiAgICAgICAgbGl2ZVNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICBjb25zdCBjaGlsZFNldCA9IGNiKHZhbHVlKTtcbiAgICAgICAgICBjaGlsZFNldHMuc2V0KHZhbHVlLCBjaGlsZFNldCk7XG4gICAgICAgICAgY2hpbGRTZXRTdWJzY3JpYmUoY2hpbGRTZXQsIHZhbHVlKTtcbiAgICAgICAgICBjaGlsZFNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgIGluaXRpYWxWYWx1ZXMuYWRkKHZhbHVlKTtcbiAgICAgICAgICB9KTtcbi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AgICAgfSk7XG4gICAgICByZXR1cm4gcztcbiAgICB9LFxuICAgIGxpc3RlbihzZXRWYWx1ZXMsIGNvbnRyb2xsZXIpIHtcbiAgICAgIGxldCBtYWluU3ViQ29tcGxldGVkID0gZmFsc2U7XG4gICAgICBjb25zdCBjaGlsZFNldFN1YnM6IE1hcDxMaXZlU2V0PFU+LCBMaXZlU2V0U3Vic2NyaXB0aW9uPiA9IG5ldyBNYXAoKTtcblxuICAgICAgZnVuY3Rpb24gY2hpbGRTZXRTdWJzY3JpYmUoY2hpbGRTZXQ6IExpdmVTZXQ8VT4sIHZhbHVlOiBUKSB7XG4gICAgICAgIGNoaWxkU2V0LnN1YnNjcmliZSh7XG4gICAgICAgICAgc3RhcnQoc3ViKSB7XG4gICAgICAgICAgICBjaGlsZFNldFN1YnMuc2V0KGNoaWxkU2V0LCBzdWIpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgbmV4dChjaGFuZ2VzKSB7XG4gICAgICAgICAgICBjaGFuZ2VzLmZvckVhY2goY2hhbmdlID0+IHtcbiAgICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWRkKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2hhbmdlLnR5cGUgPT09ICdyZW1vdmUnKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmRlbGV0ZShjaGlsZFNldCk7XG4gICAgICAgICAgICBjaGlsZFNldHMuZ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gICAgICAgICAgIGlmICghY2hpbGRTZXRTdWIpIHRocm93IEVycm9yKCdjaGlsZFNldCB3YXMgbm90IHN1YnNjcmliZWQgdG8nKTtcbiAgICAgICAgICAgICAgY2hpbGRTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUodmFsdWUpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgY2hpbGRTZXRTdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmRlbGV0ZShjaGlsZFNldCk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0cy5kZWxldGUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICB9LFxuICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICBtYWluU3ViQ29tcGxldGVkID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoY2hpbGRTZXRTdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgY29uc3QgY2hpbGRTZXRzOiBNYXA8VCwgTGl2ZVNldDxVPj4gPSBuZXcgTWFwKCk7XG4gICAgICB7XG4gICAgICAgIGNvbnN0IGluaXRpYWxWYWx1ZXMgPSBuZXcgU2V0KCk7XG4gICAgICAgIGxpdmVTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgY29uc3QgY2hpbGRTZXQgPSBjYih2YWx1ZSk7XG4gICAgICAgICAgY2hpbGRTZXRzLnNldCh2YWx1ZSwgY2hpbGRTZXQpO1xuICAgICAgICAgIGNoaWxkU2V0U3Vic2NyaWJlKGNoaWxkU2V0LCB2YWx1ZSk7XG4gICAgICAgICAgY2hpbGRTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICBpbml0aWFsVmFsdWVzLmFkZCh2YWx1ZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICAgICAgICBzZXRWYWx1ZXMoaW5pdGlhbFZhbHVlcyk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB7XG4gICAgICAgIHVuc3Vic2NyaWJlKCkge1xuICAgICAgICAgIG1haW5TdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgY2hpbGRTZXRzLmNsZWFyKCk7XG4gICAgICAgIH0sXG4gICAgICAgIHB1bGxDaGFuZ2VzKCkge1xuICAgICAgICAgIG1haW5TdWIucHVsbENoYW5nZXMoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== |
119
index.js
@@ -37,4 +37,3 @@ 'use strict'; | ||
this._values = null; | ||
this._activeController = null; | ||
this._listenCleanup = null; | ||
this._active = null; | ||
this._ended = false; | ||
@@ -72,5 +71,17 @@ this._endedWithError = false; | ||
} | ||
observersToCall.forEach(function (observer) { | ||
if (observer.next) { | ||
observer.next(changes); | ||
observersToCall.forEach(function (record) { | ||
var observer = record.observer, | ||
ignore = record.ignore; | ||
var observerNext = observer.next; | ||
if (observerNext) { | ||
if (ignore === 0) { | ||
observerNext.call(observer, changes); | ||
} else { | ||
record.ignore = 0; | ||
var changesToDeliver = changes.slice(ignore); | ||
if (changesToDeliver.length) { | ||
observerNext.call(observer, changes); | ||
} | ||
} | ||
} | ||
@@ -91,7 +102,8 @@ if (ended) { | ||
value: function _deactivate() { | ||
this._activeController = null; | ||
var listenCleanup = this._listenCleanup; | ||
if (listenCleanup) { | ||
this._listenCleanup = null; | ||
listenCleanup(); | ||
if (!this._active) throw new Error('already inactive'); | ||
var listenHandler = this._active.listenHandler; | ||
this._active = null; | ||
if (listenHandler) { | ||
listenHandler.unsubscribe(); | ||
} | ||
@@ -103,3 +115,11 @@ } | ||
if (this._values) { | ||
return new _set2.default(this._values); | ||
var _values = this._values; | ||
if (this._active) { | ||
var _listenHandler = this._active.listenHandler; | ||
if (_listenHandler.pullChanges) { | ||
_listenHandler.pullChanges(); | ||
} | ||
} | ||
return new _set2.default(_values); | ||
} else { | ||
@@ -140,3 +160,4 @@ return this._init.read(); | ||
subscription.closed = true; | ||
} | ||
}, | ||
pullChanges: function pullChanges() {} | ||
}; | ||
@@ -158,12 +179,13 @@ if (observer.start) { | ||
this._observers.push(observer); | ||
var observerRecord = { observer: observer, ignore: this._changeQueue.length }; | ||
this._observers.push(observerRecord); | ||
var subscription = { | ||
/*:: closed: false&&` */get closed() { | ||
return liveSet._observers.indexOf(observer) < 0; | ||
return liveSet._observers.indexOf(observerRecord) < 0; | ||
} /*:: ` */ | ||
, unsubscribe: function unsubscribe() { | ||
var ix = _this2._observers.indexOf(observer); | ||
var ix = _this2._observers.indexOf(observerRecord); | ||
if (ix >= 0) { | ||
_this2._observers.splice(ix, 1); | ||
if (_this2._observers.length === 0) { | ||
if (!_this2._ended && _this2._observers.length === 0) { | ||
_this2._values = null; | ||
@@ -173,2 +195,13 @@ _this2._deactivate(); | ||
} | ||
}, | ||
pullChanges: function pullChanges() { | ||
var changeQueueLength = _this2._changeQueue.length; | ||
var originalNext = observer.next; | ||
if (changeQueueLength !== 0 && originalNext) { | ||
var changesToDeliver = _this2._changeQueue.slice(observerRecord.ignore); | ||
if (changesToDeliver.length !== 0) { | ||
observerRecord.ignore = changeQueueLength; | ||
originalNext.call(observer, changesToDeliver); | ||
} | ||
} | ||
} | ||
@@ -180,8 +213,8 @@ }; | ||
// Check that they haven't immediately unsubscribed | ||
if (this._observers[this._observers.length - 1] === observer && !this._activeController) { | ||
if (this._observers[this._observers.length - 1] === observerRecord && !this._active) { | ||
(function () { | ||
var controller = _this2._activeController = { | ||
var controller = { | ||
// Flow doesn't support getters and setters yet | ||
/*:: closed: false&&` */get closed() { | ||
return liveSet._activeController !== this; | ||
return !liveSet._active || liveSet._active.controller !== this; | ||
} /*:: ` */ | ||
@@ -219,2 +252,8 @@ , add: function add(value) { | ||
}; | ||
var active = _this2._active = { | ||
controller: controller, | ||
listenHandler: { | ||
unsubscribe: function unsubscribe() {} | ||
} | ||
}; | ||
var setValuesError = function setValuesError() { | ||
@@ -237,3 +276,3 @@ throw new Error('setValues must be called once during listen'); | ||
}); | ||
var cleanup = _this2._init.listen(function (values) { | ||
var listenHandlerOrFunction = _this2._init.listen(function (values) { | ||
return setValues(values); | ||
@@ -244,31 +283,19 @@ }, controller); | ||
} | ||
if (cleanup != null) { | ||
if (typeof cleanup.unsubscribe === 'function') { | ||
_this2._listenCleanup = function () { | ||
cleanup.unsubscribe(); | ||
}; | ||
} else if (typeof cleanup !== 'function') { | ||
throw new TypeError('listen must return null or a function'); | ||
} else { | ||
_this2._listenCleanup = cleanup; | ||
} | ||
if (controller.closed) { | ||
_this2._deactivate(); | ||
} | ||
observerRecord.ignore = _this2._changeQueue.length; | ||
if (typeof listenHandlerOrFunction === 'function') { | ||
active.listenHandler = { | ||
unsubscribe: listenHandlerOrFunction | ||
}; | ||
} else if (listenHandlerOrFunction != null && typeof listenHandlerOrFunction.unsubscribe === 'function') { | ||
active.listenHandler = listenHandlerOrFunction; | ||
} else if (listenHandlerOrFunction != null) { | ||
throw new TypeError('listen must return object with unsubscribe method, a function, or null'); | ||
} | ||
if (controller.closed) { | ||
_this2._active = active; | ||
_this2._deactivate(); | ||
} | ||
})(); | ||
} | ||
var changeQueueLength = this._changeQueue.length; | ||
var originalNext = observer.next; | ||
if (changeQueueLength !== 0 && originalNext) { | ||
observer.next = function (changes) { | ||
observer.next = originalNext; | ||
var newChanges = changes.slice(changeQueueLength); | ||
if (newChanges.length !== 0) { | ||
originalNext.call(observer, newChanges); | ||
} | ||
}; | ||
} | ||
return subscription; | ||
@@ -306,2 +333,2 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJMaXZlU2V0IiwiaW5pdCIsIl92YWx1ZXMiLCJfYWN0aXZlQ29udHJvbGxlciIsIl9saXN0ZW5DbGVhbnVwIiwiX2VuZGVkIiwiX2VuZGVkV2l0aEVycm9yIiwiX2Vycm9yIiwiX3F1ZXVlZENhbGwiLCJfY2hhbmdlUXVldWUiLCJfb2JzZXJ2ZXJzIiwiX2luaXQiLCJyZWNvcmQiLCJwdXNoIiwiY2hhbmdlcyIsIm9ic2VydmVyc1RvQ2FsbCIsImVuZGVkIiwic2xpY2UiLCJmb3JFYWNoIiwib2JzZXJ2ZXIiLCJuZXh0IiwiZXJyb3IiLCJjb21wbGV0ZSIsImxpc3RlbkNsZWFudXAiLCJyZWFkIiwib2JzZXJ2ZXJPck9uTmV4dCIsIm9uRXJyb3IiLCJvbkNvbXBsZXRlIiwibGl2ZVNldCIsInN1YnNjcmlwdGlvbiIsImNsb3NlZCIsInVuc3Vic2NyaWJlIiwic3RhcnQiLCJpbmRleE9mIiwiaXgiLCJzcGxpY2UiLCJsZW5ndGgiLCJfZGVhY3RpdmF0ZSIsImNvbnRyb2xsZXIiLCJhZGQiLCJ2YWx1ZXMiLCJFcnJvciIsImhhcyIsInZhbHVlIiwiX3F1ZXVlQ2hhbmdlIiwidHlwZSIsInJlbW92ZSIsImRlbGV0ZSIsImVyciIsImVuZCIsInNldFZhbHVlc0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ufVxuXG4vLyBBc3NpZ24gaGVyZSBiZWNhdXNlIEZsb3cgZG9lc24ndCBzdXBwb3J0IGNvbXB1dGVkIHByb3BlcnR5IGtleXMgb24gY2xhc3Nlczpcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9mYWNlYm9vay9mbG93L2lzc3Vlcy8yMjg2XG4oTGl2ZVNldDphbnkpLnByb3RvdHlwZVskJG9ic2VydmFibGVdID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiB0aGlzO1xufTtcbiJdfQ== |
17
merge.js
@@ -71,6 +71,13 @@ 'use strict'; | ||
} | ||
return function () { | ||
subs.forEach(function (sub) { | ||
sub.unsubscribe(); | ||
}); | ||
return { | ||
unsubscribe: function unsubscribe() { | ||
subs.forEach(function (sub) { | ||
sub.unsubscribe(); | ||
}); | ||
}, | ||
pullChanges: function pullChanges() { | ||
subs.forEach(function (sub) { | ||
sub.pullChanges(); | ||
}); | ||
} | ||
}; | ||
@@ -82,2 +89,2 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tZXJnZS5qcyJdLCJuYW1lcyI6WyJtZXJnZSIsImxpdmVTZXRzIiwicmVhZCIsInMiLCJmb3JFYWNoIiwibGl2ZVNldCIsInZhbHVlcyIsImFkZCIsInZhbHVlIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsImluaXRpYWxWYWx1ZXMiLCJzdWJzIiwiZG9uZVN1YnNjcmliaW5nIiwic3ViIiwic3Vic2NyaWJlIiwic3RhcnQiLCJfc3ViIiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwicmVtb3ZlIiwiZXJyb3IiLCJlcnIiLCJjb21wbGV0ZSIsImRlbGV0ZSIsInNpemUiLCJlbmQiLCJ1bnN1YnNjcmliZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztrQkFJd0JBLEs7O0FB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nZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgIHMuYWRkKHZhbHVlKTtcbiAgICAgICAgfSk7XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBzO1xuICAgIH0sXG4gICAgbGlzdGVuKHNldFZhbHVlcywgY29udHJvbGxlcikge1xuICAgICAgY29uc3QgaW5pdGlhbFZhbHVlcyA9IG5ldyBTZXQoKTtcbiAgICAgIGNvbnN0IHN1YnMgPSBuZXcgU2V0KCk7XG4gICAgICBsZXQgZG9uZVN1YnNjcmliaW5nID0gZmFsc2U7XG4gICAgICBsaXZlU2V0cy5mb3JFYWNoKGxpdmVTZXQgPT4ge1xuICAgICAgICBsZXQgc3ViO1xuICAgICAgICBsaXZlU2V0LnN1YnNjcmliZSh7XG4gICAgICAgICAgc3RhcnQoX3N1Yikge1xuICAgICAgICAgICAgc3ViID0gX3N1YjtcbiAgICAgICAgICAgIHN1YnMuYWRkKHN1Yik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgICBzdWJzLmRlbGV0ZShzdWIpO1xuICAgICAgICAgICAgaWYgKGRvbmVTdWJzY3JpYmluZyAmJiBzdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBsaXZlU2V0LnZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgIGluaXRpYWxWYWx1ZXMuYWRkKHZhbHVlKTtcbiAgICAgICAgfSk7XG4gICAgICB9KTtcblxuICAgICAgc2V0VmFsdWVzKGluaXRpYWxWYWx1ZXMpO1xuXG4gICAgICBkb25lU3Vic2NyaWJpbmcgPSB0cnVlO1xuICAgICAgaWYgKHN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgfVxuICAgICAgcmV0dXJuICgpID0+IHtcbiAgICAgICAgc3Vicy5mb3JFYWNoKHN1YiA9PiB7XG4gICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgIH0pO1xuICAgICAgfTtcbiAgICB9XG4gIH0pO1xufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tZXJnZS5qcyJdLCJuYW1lcyI6WyJtZXJnZSIsImxpdmVTZXRzIiwicmVhZCIsInMiLCJmb3JFYWNoIiwibGl2ZVNldCIsInZhbHVlcyIsImFkZCIsInZhbHVlIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsImluaXRpYWxWYWx1ZXMiLCJzdWJzIiwiZG9uZVN1YnNjcmliaW5nIiwic3ViIiwic3Vic2NyaWJlIiwic3RhcnQiLCJfc3ViIiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwicmVtb3ZlIiwiZXJyb3IiLCJlcnIiLCJjb21wbGV0ZSIsImRlbGV0ZSIsInNpemUiLCJlbmQiL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gICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICAgIHN1YnMuZGVsZXRlKHN1Yik7XG4gICAgICAgICAgICBpZiAoZG9uZVN1YnNjcmliaW5nICYmIHN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIGxpdmVTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgaW5pdGlhbFZhbHVlcy5hZGQodmFsdWUpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuXG4gICAgICBzZXRWYWx1ZXMoaW5pdGlhbFZhbHVlcyk7XG5cbiAgICAgIGRvbmVTdWJzY3JpYmluZyA9IHRydWU7XG4gICAgICBpZiAoc3Vicy5zaXplID09PSAwKSB7XG4gICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICB9XG4gICAgICByZXR1cm4ge1xuICAgICAgICB1bnN1YnNjcmliZSgpIHtcbiAgICAgICAgICBzdWJzLmZvckVhY2goc3ViID0+IHtcbiAgICAgICAgICAgIHN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwdWxsQ2hhbmdlcygpIHtcbiAgICAgICAgICBzdWJzLmZvckVhY2goc3ViID0+IHtcbiAgICAgICAgICAgIHN1Yi5wdWxsQ2hhbmdlcygpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgfSk7XG59XG4iXX0= |
{ | ||
"name": "live-set", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Class representing a changing and transformable collection of items.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
108112
831