check-tag-matches
Version:
Checks if the package.json version matches current tag
13 lines (10 loc) • 339 B
JavaScript
const checkTagMatchesFactory = ({ getGitHeadTags, getPackageVersion }) =>
function (cwd = '.', tagPrefix = 'v') {
const prefixed = `${tagPrefix}${getPackageVersion(cwd)}`
return getGitHeadTags().reduce(
(match, tag) => match || tag === prefixed,
false
)
}
module.exports = checkTagMatchesFactory