mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-26 07:20:39 +00:00
a561b74314
* chore(deps): update dependency @biomejs/biome to v2.4.11 | datasource | package | from | to | | ---------- | -------------- | ----- | ------ | | npm | @biomejs/biome | 2.4.6 | 2.4.11 | * fixup linter changes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com> Co-authored-by: secustor <sebastian@poxhofer.at>
41 lines
938 B
TypeScript
41 lines
938 B
TypeScript
import { regEx } from '../../../util/regex.ts';
|
|
|
|
const regex = regEx(/^(?<codename>\w+)-(?<date>\d{8})(?<suffix>\.\d{1,2})?$/);
|
|
|
|
function isDatedCodeName(input: string): boolean {
|
|
return regex.test(input);
|
|
}
|
|
|
|
function getDatedContainerImageCodename(version: string): null | string {
|
|
const groups = regex.exec(version);
|
|
if (!groups?.groups) {
|
|
return null;
|
|
}
|
|
return groups.groups.codename;
|
|
}
|
|
|
|
function getDatedContainerImageVersion(version: string): null | number {
|
|
const groups = regex.exec(version);
|
|
if (!groups?.groups) {
|
|
return null;
|
|
}
|
|
|
|
return parseInt(groups.groups.date, 10);
|
|
}
|
|
|
|
function getDatedContainerImageSuffix(version: string): null | string {
|
|
const groups = regex.exec(version);
|
|
if (!groups?.groups?.suffix) {
|
|
return null;
|
|
}
|
|
|
|
return groups.groups.suffix;
|
|
}
|
|
|
|
export {
|
|
getDatedContainerImageCodename,
|
|
getDatedContainerImageSuffix,
|
|
getDatedContainerImageVersion,
|
|
isDatedCodeName,
|
|
};
|