Skip to content

Commit

Permalink
Merge pull request #2 from jser/feature/1
Browse files Browse the repository at this point in the history
feat: support v\d-\d pattern
  • Loading branch information
azu authored Mar 10, 2024
2 parents ee5ed46 + 77e1fdd commit 8e1959a
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 8e1959a

Please sign in to comment.