Skip to content

Commit

Permalink
feat: support v\d-\d pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Mar 10, 2024
1 parent ee5ed46 commit 77e1fdd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ export const RELEASE_RULE: ReleaseRuleItem[] = [
output: undefined,
}],
},
{
matchVersion: (url: string) => {
return url.match(
/https:\/\/.+\/.*?v(?<version>[\d.-]+)/,
);
},
version: ({ match }) => {
return `v${match?.groups?.version?.replaceAll("-", ".")}`;
},
tests: [{
input: "https://biomejs.dev/blog/biome-v1-6/",
output: "v1.6",
},{
input: "https://example.com/voooo1-6",
output: undefined,
}],
},
];

export const URL_RULES: RuleItem[] = [
Expand Down

0 comments on commit 77e1fdd

Please sign in to comment.