UNPKG

@drewsonne/maya-dates

Version:

Typescript package to manipulate dates in the Maya Calendar

36 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var HashMap = (function () { function HashMap(raw) { this.indexToValue = raw; var initialValueToIndex = {}; this.valueToIndex = this.indexToValue.reduce(function (obj, elem, idx) { if (elem !== undefined) { obj[elem] = idx; } return obj; }, initialValueToIndex); } HashMap.prototype.getValue = function (index) { return this.indexToValue[index]; }; HashMap.prototype.getIndex = function (value) { return this.valueToIndex[value]; }; HashMap.prototype.includes = function (value) { return this.indexToValue.includes(value); }; Object.defineProperty(HashMap.prototype, "length", { get: function () { return this.indexToValue.length; }, enumerable: false, configurable: true }); HashMap.prototype.toString = function () { return "".concat(this.indexToValue); }; return HashMap; }()); exports.default = HashMap; //# sourceMappingURL=hashMap.js.map