@drewsonne/maya-dates
Version:
Typescript package to manipulate dates in the Maya Calendar
57 lines • 2.25 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var calendar_round_iter_1 = __importDefault(require("./calendar-round-iter"));
var comment_wrapper_1 = require("../comment-wrapper");
var iter = new calendar_round_iter_1.default();
var CalendarRoundWildcard = (function (_super) {
__extends(CalendarRoundWildcard, _super);
function CalendarRoundWildcard(cr) {
var _this = _super.call(this) || this;
_this.cr = cr;
return _this;
}
CalendarRoundWildcard.prototype.run = function () {
var potentials = [];
var cr = iter.next();
while (!cr.done) {
if (cr.value !== null) {
if (this.cr.match(cr.value)) {
potentials.push(cr.value);
}
}
else {
throw new Error("Iteration result is null");
}
cr = iter.next();
}
iter.reset();
return potentials;
};
CalendarRoundWildcard.prototype.equal = function (other) {
if (other instanceof CalendarRoundWildcard) {
return this.cr.equal(other.cr);
}
return false;
};
return CalendarRoundWildcard;
}(comment_wrapper_1.CommentWrapper));
exports.default = CalendarRoundWildcard;
//# sourceMappingURL=calendar-round-wildcard.js.map