Files
klz-cables.com/.pnpm-store/v10/files/1a/a1ce14d416c4ad04cf33785183b83702c1e999714e43af2dfd92f5332ce914c84b5e50c87c10084a3a58a95fad0e340fea02f9d94c720ed81b6f3f91757076
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

30 lines
720 B
Plaintext

import { numericPatterns } from "../constants.mjs";
import { Parser } from "../Parser.mjs";
import { parseNDigits, parseNumericPattern } from "../utils.mjs";
export class SecondParser extends Parser {
priority = 50;
parse(dateString, token, match) {
switch (token) {
case "s":
return parseNumericPattern(numericPatterns.second, dateString);
case "so":
return match.ordinalNumber(dateString, { unit: "second" });
default:
return parseNDigits(token.length, dateString);
}
}
validate(_date, value) {
return value >= 0 && value <= 59;
}
set(date, _flags, value) {
date.setSeconds(value, 0);
return date;
}
incompatibleTokens = ["t", "T"];
}