PHP 8.2.30
Preview: time-matcher.js Size: 1.84 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/node-cron/dist/esm/time/time-matcher.js

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimeMatcher = void 0;
const index_1 = __importDefault(require("../pattern/convertion/index"));
const week_day_names_conversion_1 = __importDefault(require("../pattern/convertion/week-day-names-conversion"));
const localized_time_1 = require("./localized-time");
const matcher_walker_1 = require("./matcher-walker");
function matchValue(allowedValues, value) {
    return allowedValues.indexOf(value) !== -1;
}
class TimeMatcher {
    timezone;
    pattern;
    expressions;
    constructor(pattern, timezone) {
        this.timezone = timezone;
        this.pattern = pattern;
        this.expressions = (0, index_1.default)(pattern);
    }
    match(date) {
        const localizedTime = new localized_time_1.LocalizedTime(date, this.timezone);
        const parts = localizedTime.getParts();
        const runOnSecond = matchValue(this.expressions[0], parts.second);
        const runOnMinute = matchValue(this.expressions[1], parts.minute);
        const runOnHour = matchValue(this.expressions[2], parts.hour);
        const runOnDay = matchValue(this.expressions[3], parts.day);
        const runOnMonth = matchValue(this.expressions[4], parts.month);
        const runOnWeekDay = matchValue(this.expressions[5], parseInt((0, week_day_names_conversion_1.default)(parts.weekday)));
        return runOnSecond && runOnMinute && runOnHour && runOnDay && runOnMonth && runOnWeekDay;
    }
    getNextMatch(date) {
        const walker = new matcher_walker_1.MatcherWalker(this.pattern, date, this.timezone);
        const next = walker.matchNext();
        return next.toDate();
    }
}
exports.TimeMatcher = TimeMatcher;
//# sourceMappingURL=time-matcher.js.map

Directory Contents

Dirs: 0 × Files: 9

Name Size Perms Modified Actions
487 B lrw-r--r-- 2026-02-21 00:54:20
Edit Download
2.77 KB lrw-r--r-- 2026-02-21 00:53:50
Edit Download
3.35 KB lrw-r--r-- 2026-02-21 00:54:04
Edit Download
418 B lrw-r--r-- 2026-02-21 00:54:20
Edit Download
4.04 KB lrw-r--r-- 2026-02-21 00:53:54
Edit Download
3.78 KB lrw-r--r-- 2026-02-21 00:54:04
Edit Download
226 B lrw-r--r-- 2026-02-21 00:54:22
Edit Download
1.84 KB lrw-r--r-- 2026-02-21 00:54:00
Edit Download
1.51 KB lrw-r--r-- 2026-02-21 00:54:10
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).