UNPKG

check-tag-matches

Version:
13 lines (10 loc) 339 B
'use strict' 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