UNPKG

connection-scan-algorithm

Version:
18 lines (17 loc) 506 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class Service { constructor(startDate, endDate, days, dates) { this.startDate = startDate; this.endDate = endDate; this.days = days; this.dates = dates; } runsOn(date, dow) { return this.dates[date] || (!this.dates.hasOwnProperty(date) && this.startDate <= date && this.endDate >= date && this.days[dow]); } } exports.Service = Service;