mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2026-04-06 08:06:53 +00:00
Support namespaces without tags.
This commit is contained in:
parent
3a712b126c
commit
ae4e812946
5 changed files with 42 additions and 37 deletions
19
dist/index.js
vendored
19
dist/index.js
vendored
|
|
@ -264,18 +264,13 @@ class DefaultTagFormatter {
|
|||
return `${this.tagPrefix}*[0-9].*[0-9].*[0-9]`;
|
||||
}
|
||||
Parse(tag) {
|
||||
let stripedTag;
|
||||
if (this.tagPrefix.includes('/') && tag.includes(this.tagPrefix)) {
|
||||
let tagParts = tag
|
||||
.replace(this.tagPrefix, '<--!PREFIX!-->')
|
||||
.split('/');
|
||||
stripedTag = tagParts[tagParts.length - 1]
|
||||
.replace('<--!PREFIX!-->', this.tagPrefix);
|
||||
}
|
||||
else {
|
||||
let tagParts = tag.split('/');
|
||||
stripedTag = tagParts[tagParts.length - 1];
|
||||
}
|
||||
let tagParts = tag
|
||||
.replace(this.tagPrefix, '<--!PREFIX!-->')
|
||||
.replace(this.namespace, '<--!NAMESPACE!-->')
|
||||
.split('/');
|
||||
const stripedTag = tagParts[tagParts.length - 1]
|
||||
.replace('<--!PREFIX!-->', this.tagPrefix)
|
||||
.replace('<--!NAMESPACE!-->', this.namespace);
|
||||
let versionValues = stripedTag
|
||||
.substring(this.tagPrefix.length)
|
||||
.slice(0, this.namespace === '' ? 999 : -(this.namespace.length + 1))
|
||||
|
|
|
|||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue