UNPKG

raptor-journey-planner

Version:

Implementation of the Round bAsed Public Transit Optimized Router (Raptor) journey planning algorithm.

23 lines (22 loc) 581 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Service = void 0; class Service { startDate; endDate; days; dates; constructor(startDate, endDate, days, dates) { this.startDate = startDate; this.endDate = endDate; this.days = days; this.dates = dates; } runsOn(date, dow) { return this.dates[date] || (!Object.hasOwn(this.dates, date) && this.startDate <= date && this.endDate >= date && this.days[dow]); } } exports.Service = Service;