UNPKG

associativearray

Version:
69 lines (68 loc) 2.58 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var pattern_1 = require("./pattern"); var Dictionary = /** @class */ (function (_super) { __extends(Dictionary, _super); function Dictionary() { return _super !== null && _super.apply(this, arguments) || this; } Dictionary.prototype.add = function (name, value) { _super.prototype.add.call(this, name, value); }; Dictionary.prototype.value = function (name) { return this.values[this.keys[name]]; }; Dictionary.prototype.push = function (value) { return _super.prototype.push.call(this, value); }; Dictionary.prototype.change = function (name, value) { _super.prototype.change.call(this, name, value); }; Dictionary.prototype.search = function (value) { return _super.prototype.search.call(this, value); }; Dictionary.prototype.copy = function (dictionary) { _super.prototype.copy.call(this, dictionary); }; Dictionary.prototype.share = function (dictionary, names) { _super.prototype.share.call(this, dictionary, names); }; Dictionary.prototype.concat = function () { var dictionaries = []; for (var _i = 0; _i < arguments.length; _i++) { dictionaries[_i] = arguments[_i]; } _super.prototype.concat.apply(this, dictionaries); }; Dictionary.prototype.array = function () { var complex = []; for (var i in this.names) { complex.push({ name: this.names[i], value: this.values[i] }); } return complex; }; Dictionary.prototype.fromArray = function (array) { _super.prototype.fromArray.call(this, array); }; Dictionary.prototype.forEach = function (callback) { _super.prototype.forEach.call(this, callback); }; Dictionary.prototype.sort = function (handler) { _super.prototype.sort.call(this, handler); }; return Dictionary; }(pattern_1.Pattern)); exports.Dictionary = Dictionary;