diff --git a/lib/_OrderedDict.js b/lib/_OrderedDict.js deleted file mode 100644 index e7e08e6..0000000 --- a/lib/_OrderedDict.js +++ /dev/null @@ -1,349 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _OrderedDict; - -var _jsError = require('@aureooms/js-error'); - -var _jsMapping = require('@aureooms/js-mapping'); - -function _OrderedDict(Dict, Map, DoublyLinkedList) { - - var OrderedDict = function OrderedDict(mapping) { - - this.container = new Map(); - - this.map = new Map(); - - this.list = new DoublyLinkedList(); - - if (mapping !== null) this.update(mapping); - }; - - OrderedDict.prototype = new Dict(); - - OrderedDict.prototype.isequal = function (other) { - - if (!(other instanceof OrderedDict)) return false; - - if (!Dict.prototype.isequal.call(this, other)) return false; - - var keys = this.keys(); - - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; - - try { - for (var _iterator = other.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { - var key = _step.value; - - - if (keys.next().value !== key) return false; - } - } catch (err) { - _didIteratorError = true; - _iteratorError = err; - } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } - } - - return true; - }; - - OrderedDict.prototype.set = function (key, value) { - - if (!this.has(key)) { - - this.map.set(key, this.list.push(key)); - } - - this.container.set(key, value); - - return this; - }; - - OrderedDict.prototype.delete = function (key) { - - if (!this.container.delete(key)) throw new _jsError.KeyError(); - - this.list.erase(this.map.get(key)); - this.map.delete(key); - - return this; - }; - - OrderedDict.prototype.clear = function () { - - this.container.clear(); - - this.map.clear(); - - this.list.clear(); - - return this; - }; - - OrderedDict.prototype.copy = function () { - - return new OrderedDict(this.items()); - }; - - OrderedDict.fromkeys = function (seq) { - var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - - - return new OrderedDict((0, _jsMapping.fromkeys)(seq, value)); - }; - - OrderedDict.prototype.popitem = function () { - var last = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; - - - if (this.len() === 0) throw new _jsError.KeyError(); - - var key = last ? this.list.end().prev().value : this.list.begin().next().value; - - return [key, this.pop(key)]; - }; - - OrderedDict.prototype.move_to_end = function (key) { - var last = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; - - - if (!this.container.has(key)) throw new _jsError.KeyError(); - - this.list.erase(this.map.get(key)); - - var iterator = last ? this.list.push(key) : this.list.unshift(key); - - this.map.set(key, iterator); - - return this; - }; - - OrderedDict.prototype.keys = regeneratorRuntime.mark(function _callee() { - var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, key; - - return regeneratorRuntime.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _iteratorNormalCompletion2 = true; - _didIteratorError2 = false; - _iteratorError2 = undefined; - _context.prev = 3; - _iterator2 = this.list[Symbol.iterator](); - - case 5: - if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) { - _context.next = 12; - break; - } - - key = _step2.value; - _context.next = 9; - return key; - - case 9: - _iteratorNormalCompletion2 = true; - _context.next = 5; - break; - - case 12: - _context.next = 18; - break; - - case 14: - _context.prev = 14; - _context.t0 = _context['catch'](3); - _didIteratorError2 = true; - _iteratorError2 = _context.t0; - - case 18: - _context.prev = 18; - _context.prev = 19; - - if (!_iteratorNormalCompletion2 && _iterator2.return) { - _iterator2.return(); - } - - case 21: - _context.prev = 21; - - if (!_didIteratorError2) { - _context.next = 24; - break; - } - - throw _iteratorError2; - - case 24: - return _context.finish(21); - - case 25: - return _context.finish(18); - - case 26: - case 'end': - return _context.stop(); - } - } - }, _callee, this, [[3, 14, 18, 26], [19,, 21, 25]]); - }); - - OrderedDict.prototype.values = regeneratorRuntime.mark(function _callee2() { - var _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, key; - - return regeneratorRuntime.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _iteratorNormalCompletion3 = true; - _didIteratorError3 = false; - _iteratorError3 = undefined; - _context2.prev = 3; - _iterator3 = this.keys()[Symbol.iterator](); - - case 5: - if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) { - _context2.next = 12; - break; - } - - key = _step3.value; - _context2.next = 9; - return this.container.get(key); - - case 9: - _iteratorNormalCompletion3 = true; - _context2.next = 5; - break; - - case 12: - _context2.next = 18; - break; - - case 14: - _context2.prev = 14; - _context2.t0 = _context2['catch'](3); - _didIteratorError3 = true; - _iteratorError3 = _context2.t0; - - case 18: - _context2.prev = 18; - _context2.prev = 19; - - if (!_iteratorNormalCompletion3 && _iterator3.return) { - _iterator3.return(); - } - - case 21: - _context2.prev = 21; - - if (!_didIteratorError3) { - _context2.next = 24; - break; - } - - throw _iteratorError3; - - case 24: - return _context2.finish(21); - - case 25: - return _context2.finish(18); - - case 26: - case 'end': - return _context2.stop(); - } - } - }, _callee2, this, [[3, 14, 18, 26], [19,, 21, 25]]); - }); - - OrderedDict.prototype.items = regeneratorRuntime.mark(function _callee3() { - var _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, key; - - return regeneratorRuntime.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - _iteratorNormalCompletion4 = true; - _didIteratorError4 = false; - _iteratorError4 = undefined; - _context3.prev = 3; - _iterator4 = this.keys()[Symbol.iterator](); - - case 5: - if (_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done) { - _context3.next = 12; - break; - } - - key = _step4.value; - _context3.next = 9; - return [key, this.container.get(key)]; - - case 9: - _iteratorNormalCompletion4 = true; - _context3.next = 5; - break; - - case 12: - _context3.next = 18; - break; - - case 14: - _context3.prev = 14; - _context3.t0 = _context3['catch'](3); - _didIteratorError4 = true; - _iteratorError4 = _context3.t0; - - case 18: - _context3.prev = 18; - _context3.prev = 19; - - if (!_iteratorNormalCompletion4 && _iterator4.return) { - _iterator4.return(); - } - - case 21: - _context3.prev = 21; - - if (!_didIteratorError4) { - _context3.next = 24; - break; - } - - throw _iteratorError4; - - case 24: - return _context3.finish(21); - - case 25: - return _context3.finish(18); - - case 26: - case 'end': - return _context3.stop(); - } - } - }, _callee3, this, [[3, 14, 18, 26], [19,, 21, 25]]); - }); - - OrderedDict.prototype[Symbol.iterator] = OrderedDict.prototype.items; - - return OrderedDict; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9fT3JkZXJlZERpY3QuanMiXSwibmFtZXMiOlsiX09yZGVyZWREaWN0IiwiRGljdCIsIk1hcCIsIkRvdWJseUxpbmtlZExpc3QiLCJPcmRlcmVkRGljdCIsIm1hcHBpbmciLCJjb250YWluZXIiLCJtYXAiLCJsaXN0IiwidXBkYXRlIiwicHJvdG90eXBlIiwiaXNlcXVhbCIsIm90aGVyIiwiY2FsbCIsImtleXMiLCJrZXkiLCJuZXh0IiwidmFsdWUiLCJzZXQiLCJoYXMiLCJwdXNoIiwiZGVsZXRlIiwiZXJhc2UiLCJnZXQiLCJjbGVhciIsImNvcHkiLCJpdGVtcyIsImZyb21rZXlzIiwic2VxIiwicG9waXRlbSIsImxhc3QiLCJsZW4iLCJlbmQiLCJwcmV2IiwiYmVnaW4iLCJwb3AiLCJtb3ZlX3RvX2VuZCIsIml0ZXJhdG9yIiwidW5zaGlmdCIsInZhbHVlcyIsIlN5bWJvbCJdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBR3dCQSxZOztBQUh4Qjs7QUFDQTs7QUFFZSxTQUFTQSxZQUFULENBQXdCQyxJQUF4QixFQUErQkMsR0FBL0IsRUFBcUNDLGdCQUFyQyxFQUF3RDs7QUFFdEUsS0FBTUMsY0FBYyxTQUFkQSxXQUFjLENBQVdDLE9BQVgsRUFBcUI7O0FBRXhDLE9BQUtDLFNBQUwsR0FBaUIsSUFBSUosR0FBSixFQUFqQjs7QUFFQSxPQ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1N5bWJvbC5pdGVyYXRvcl0gPSBPcmRlcmVkRGljdC5wcm90b3R5cGUuaXRlbXMgO1xuXG5cdHJldHVybiBPcmRlcmVkRGljdCA7XG5cbn1cbiJdfQ== \ No newline at end of file diff --git a/lib/_ordereddict.js b/lib/_ordereddict.js deleted file mode 100644 index 1dfa127..0000000 --- a/lib/_ordereddict.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = _ordereddict; -function _ordereddict(OrderedDict) { - - var ordereddict = function ordereddict() { - var mapping = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - - - return new OrderedDict(mapping); - }; - - ordereddict.fromkeys = OrderedDict.fromkeys; - - return ordereddict; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9fb3JkZXJlZGRpY3QuanMiXSwibmFtZXMiOlsiX29yZGVyZWRkaWN0IiwiT3JkZXJlZERpY3QiLCJvcmRlcmVkZGljdCIsIm1hcHBpbmciLCJmcm9ta2V5cyJdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBQ3dCQSxZO0FBQVQsU0FBU0EsWUFBVCxDQUF3QkMsV0FBeEIsRUFBc0M7O0FBRXBELEtBQU1DLGNBQWMsU0FBZEEsV0FBYyxHQUE0QjtBQUFBLE1BQWpCQyxPQUFpQix1RUFBUCxJQUFPOzs7QUFFL0MsU0FBTyxJQUFJRixXQUFKLENBQWlCRSxPQUFqQixDQUFQO0FBRUEsRUFKRDs7QUFNQUQsYUFBWUUsUUFBWixHQUF1QkgsWUFBWUcsUUFBbkM7O0FBRUEsUUFBT0YsV0FBUDtBQUVBIiwiZmlsZSI6Il9vcmRlcmVkZGljdC5qcyIsInNvdXJjZXNDb250ZW50IjpbIlxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gX29yZGVyZWRkaWN0ICggT3JkZXJlZERpY3QgKSB7XG5cblx0Y29uc3Qgb3JkZXJlZGRpY3QgPSBmdW5jdGlvbiAoIG1hcHBpbmcgPSBudWxsICkge1xuXG5cdFx0cmV0dXJuIG5ldyBPcmRlcmVkRGljdCggbWFwcGluZyApIDtcblxuXHR9IDtcblxuXHRvcmRlcmVkZGljdC5mcm9ta2V5cyA9IE9yZGVyZWREaWN0LmZyb21rZXlzIDtcblxuXHRyZXR1cm4gb3JkZXJlZGRpY3QgO1xuXG59XG4iXX0= \ No newline at end of file diff --git a/lib/index.js b/lib/index.js deleted file mode 100644 index 8675249..0000000 --- a/lib/index.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports._OrderedDict = exports._ordereddict = exports.OrderedDict = exports.ordereddict = undefined; - -var _OrderedDict2 = require('./_OrderedDict'); - -var _OrderedDict3 = _interopRequireDefault(_OrderedDict2); - -var _ordereddict2 = require('./_ordereddict'); - -var _ordereddict3 = _interopRequireDefault(_ordereddict2); - -var _jsCollectionsDict = require('@aureooms/js-collections-dict'); - -var _jsDll = require('@aureooms/js-dll'); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var OrderedDict = (0, _OrderedDict3.default)(_jsCollectionsDict.Dict, Map, _jsDll.DoublyLinkedList); // Map is the native map implementation -var ordereddict = (0, _ordereddict3.default)(OrderedDict); - -exports.default = ordereddict; -exports.ordereddict = ordereddict; -exports.OrderedDict = OrderedDict; -exports._ordereddict = _ordereddict3.default; -exports._OrderedDict = _OrderedDict3.default; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJPcmRlcmVkRGljdCIsIk1hcCIsIm9yZGVyZWRkaWN0IiwiX29yZGVyZWRkaWN0IiwiX09yZGVyZWREaWN0Il0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7Ozs7QUFDQTs7OztBQUVBOztBQUNBOzs7O0F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