Comparing version 0.1.3 to 0.2.0
@@ -77,3 +77,4 @@ 'use strict'; | ||
_this._allByTag = new _map2.default(init.tags.map(function (_ref2) { | ||
_this._allByTag = new _map2.default(); | ||
init.tags.forEach(function (_ref2) { | ||
var tag = _ref2.tag; | ||
@@ -85,4 +86,5 @@ | ||
return [tag, { ownedTags: new _set2.default(), liveSet: liveSet, controller: controller }]; | ||
})); | ||
if (_this._allByTag.has(tag)) throw new Error('Tag specified twice: ' + tag); | ||
_this._allByTag.set(tag, { ownedTags: new _set2.default(), liveSet: liveSet, controller: controller }); | ||
}); | ||
@@ -203,2 +205,2 @@ init.tags.forEach(function (_ref3) { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9UYWdUcmVlLmpzIl0sIm5hbWVzIjpbIkVNUFRZX0FSUkFZIiwiVGFnVHJlZSIsImluaXQiLCJyb290Tm9kZUNvbnRyb2xsZXIiLCJ2YWx1ZSIsInJvb3QiLCJwYXJlbnQiLCJvd25lZFRhZ3MiLCJ0YWdzIiwibWFwIiwidGFnIiwiZXhlY3V0b3IiLCJjb250cm9sbGVyIiwiX25vZGVDb250cm9sbGVycyIsIl9sb29rdXBUYWJsZSIsIkVycm9yIiwic2V0IiwiX2FsbEJ5VGFnIiwiYWN0aXZlIiwibGl2ZVNldCIsImZvckVhY2giLCJvd25lZEJ5IiwiZW50cnkiLCJnZXQiLCJvd25pbmdUYWciLCJhZGQiLCJhZGRUYWdnZWRWYWx1ZSIsInRhZ0VudHJ5Iiwibm9kZSIsIl9jb250cm9sbGVyIiwidmFsdWVOb2RlcyIsInB1c2giLCJwYXJlbnRDb250cm9sbGVyIiwiYWRkT3duZWROb2RlIiwicmVtb3ZlVGFnZ2VkTm9kZSIsImdldFZhbHVlIiwibm9kZXMiLCJsZW5ndGgiLCJpeCIsImluZGV4T2YiLCJzcGxpY2UiLCJkZWxldGUiLCJnZXRPd25lZCIsInZ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R1cm4gW3RhZywge293bmVkVGFnczogbmV3IFNldCgpLCBsaXZlU2V0LCBjb250cm9sbGVyfV07XG4gICAgfSkpO1xuXG4gICAgaW5pdC50YWdzLmZvckVhY2goKHt0YWcsIG93bmVkQnl9KSA9PiB7XG4gICAgICBpZiAoIW93bmVkQnkpIHJldHVybjtcbiAgICAgIG93bmVkQnkuZm9yRWFjaChvd25pbmdUYWcgPT4ge1xuICAgICAgICBjb25zdCBlbnRyeSA9IHRoaXMuX2FsbEJ5VGFnLmdldChvd25pbmdUYWcpO1xuICAgICAgICBpZiAoIWVudHJ5KSB0aHJvdyBuZXcgRXJyb3IoYHVua25vd24gb3duZWRCeSB2YWx1ZSBmb3IgJHt0YWd9OiAke293bmluZ1RhZ31gKTtcbiAgICAgICAgZW50cnkub3duZWRUYWdzLmFkZCh0YWcpO1xuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICBjb25zdCBjb250cm9sbGVyID0ge1xuICAgICAgYWRkVGFnZ2VkVmFsdWU6IChwYXJlbnQsIHRhZywgdmFsdWUpID0+IHtcbiAgICAgICAgY29uc3QgdGFnRW50cnkgPSB0aGlzLl9hbGxCeVRhZy5nZXQodGFnKTtcbiAgICAgICAgaWYgKCF0YWdFbnRyeSkgdGhyb3cgbmV3IEVycm9yKGB1bmtub3duIHRhZzogJHt0YWd9YCk7XG5cbiAgICAgICAgbGV0IGNvbnRyb2xsZXI7XG4gICAgICAgIGNvbnN0IG5vZGUgPSBuZXcgVGFnVHJlZU5vZGUoe1xuICAgICAgICAgIHZhbHVlLFxuICAgICAgICAgIHBhcmVudCxcbiAgICAgICAgICBvd25lZFRhZ3M6IHRhZ0VudHJ5Lm93bmVkVGFncyxcbiAgICAgICAgICBleGVjdXRvcjogKF9jb250cm9sbGVyKSA9PiB7XG4gICAgICAgICAgICBjb250cm9sbGVyID0gX2NvbnRyb2xsZXI7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgaWYgKCFjb250cm9sbGVyKSB0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lZm9yZSByZW1vdmFsJyk7XG4gICAgICAgIGlmIChub2Rlcy5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgY29uc3QgaXggPSBub2Rlcy5pbmRleE9mKG5vZGUpO1xuICAgICAgICAgIGlmIChpeCA8IDApIHRocm93IG5ldyBFcnJvcignbm9kZSB3YXMgbWlzc2luZyBmcm9tIGxpc3QgaW4gbG9va3VwIHRhYmxlIGJlZm9yZSByZW1vdmFsJyk7XG4gICAgICAgICAgbm9kZXMuc3BsaWNlKGl4LCAxKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9sb29rdXBUYWJsZS5kZWxldGUodmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgbm9kZS5nZXRPd25lZCgpLmZvckVhY2goKGxpdmVTZXQsIHRhZykgPT4ge1xuICAgICAgICAgIGxpdmVTZXQudmFsdWVzKCkuZm9yRWFjaChjaGlsZE5vZGUgPT4ge1xuICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmVUYWdnZWROb2RlKG5vZGUsIHRhZywgY2hpbGROb2RlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgdGFnRW50cnkuY29udHJvbGxlci5yZW1vdmUobm9kZSk7XG5cbiAgICAgICAgY29uc3QgcGFyZW50Q29udHJvbGxlciA9IHRoaXMuX25vZGVDb250cm9sbGVycy5nZXQocGFyZW50KTtcbiAgICAgICAgaWYgKCFwYXJlbnRDb250cm9sbGVyKSB0aHJvdyBuZXcgRXJyb3IoJ3BhcmVudCBpcyBub3QgcGFydCBvZiBUYWdUcmVlJyk7XG4gICAgICAgIHBhcmVudENvbnRyb2xsZXIucmVtb3ZlT3duZWROb2RlKHRhZywgbm9kZSk7XG5cbiAgICAgICAgdGhpcy5fbm9kZUNvbnRyb2xsZXJzLmRlbGV0ZShub2RlKTtcbiAgICAgIH0sXG4gICAgICBlbmQ6ICgpID0+IHtcbiAgICAgICAgdGhpcy5fbm9kZUNvbnRyb2xsZXJzLmZvckVhY2goY29udHJvbGxlciA9PiB7XG4gICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfTtcbiAgICBpbml0LmV4ZWN1dG9yKGNvbnRyb2xsZXIpO1xuICAgIGluaXQuZXhlY3V0b3IgPSAoKSA9PiB7fTsgLy8gcmVsZWFzZSByZWZlcmVuY2VcbiAgfVxuXG4gIGdldE5vZGVzRm9yVmFsdWUodmFsdWU6IFQpOiBBcnJheTxUYWdUcmVlTm9kZTxUPj4ge1xuICAgIGNvbnN0IGwgPSB0aGlzLl9sb29rdXBUYWJsZS5nZXQodmFsdWUpO1xuICAgIHJldHVybiBsID8gT2JqZWN0LmZyZWV6ZShsLnNsaWNlKCkpIDogKEVNUFRZX0FSUkFZOmFueSk7XG4gIH1cblxuICBnZXRBbGxCeVRhZyh0YWc6IHN0cmluZyk6IExpdmVTZXQ8VGFnVHJlZU5vZGU8VD4+IHtcbiAgICBjb25zdCBlbnRyeSA9IHRoaXMuX2FsbEJ5VGFnLmdldCh0YWcpO1xuICAgIGlmICghZW50cnkpIHRocm93IG5ldyBFcnJvcihgdGFnIGRvZXMgbm90IGV4aXN0IGluIFRhZ1RyZWU6ICR7dGFnfWApO1xuICAgIHJldHVybiBlbnRyeS5saXZlU2V0O1xuICB9XG5cbiAgZ2V0QWxsKCk6IE1hcDxzdHJpbmcsIExpdmVTZXQ8VGFnVHJlZU5vZGU8VD4+PiB7XG4gICAgY29uc3QgbSA9IG5ldyBNYXAoKTtcbiAgICB0aGlzLl9hbGxCeVRhZy5mb3JFYWNoKCh7bGl2ZVNldH0sIHRhZykgPT4ge1xuICAgICAgbS5zZXQodGFnLCBsaXZlU2V0KTtcbiAgICB9KTtcbiAgICByZXR1cm4gbTtcbiAgfVxufVxuIl19 |
{ | ||
"name": "tag-tree", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Class representing a changing tree of tagged items.", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
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
40980
282