UNPKG

@drewsonne/maya-dates

Version:

Typescript package to manipulate dates in the Maya Calendar

37 lines 1.24 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CorrelationConstant = void 0; exports.getCorrelationConstant = getCorrelationConstant; var CorrelationConstant = (function () { function CorrelationConstant(value, name) { this.value = value; this.name = name; } return CorrelationConstant; }()); exports.CorrelationConstant = CorrelationConstant; var rawCorrelationConstants = [[394483, 'Bowditch'], [489138, 'Makesom'], [489384, 'Spinden'], [584281, 'Martinéz-Hernando'], [584283, 'GMT'], [584285, 'Astronomical'], [584286, 'Martin-Skidmore'], [660208, 'Wells, Fuls'], ]; var _correlationConstants = {}; var correlationConstants = rawCorrelationConstants.reduce(function (obj, n) { var corr = new CorrelationConstant(n[0], n[1]); obj[corr.name] = corr; obj[corr.value] = corr; return obj; }, _correlationConstants); function getCorrelationConstant(id) { if (id in correlationConstants) { return correlationConstants[id]; } else { throw new Error("Could not find ".concat(id, " in defaults, and 'name' was not provided for new Correlation Constant")); } } //# sourceMappingURL=correlation-constant.js.map