mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2026-04-12 10:44:16 +00:00
Exclude pre-release tags from version consideration
This commit is contained in:
parent
ba6e71e658
commit
02763ed6d3
8 changed files with 74 additions and 10 deletions
|
|
@ -61,4 +61,12 @@ export class DefaultTagFormatter implements TagFormatter {
|
|||
return [major, minor, patch];
|
||||
};
|
||||
|
||||
public IsValid(tag: string): boolean {
|
||||
if (!!this.namespace) {
|
||||
return new RegExp(`^${this.tagPrefix}[0-9]+.[0-9]+.[0-9]+${this.namespaceSeperator}${this.namespace}$`).test(tag);
|
||||
}
|
||||
|
||||
return new RegExp(`^${this.tagPrefix}[0-9]+.[0-9]+.[0-9]+$`).test(tag);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@ export interface TagFormatter {
|
|||
Format(versionInfo: VersionInformation): string;
|
||||
GetPattern(): string;
|
||||
Parse(tag: string): [major: number, minor: number, patch: number];
|
||||
IsValid(tag: string): boolean;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue