This commit is contained in:
rkiel
2019-07-18 15:40:37 -04:00
parent 48d64da20b
commit 308d62fc86
7 changed files with 90 additions and 86 deletions

23
js/validate.js Normal file
View File

@@ -0,0 +1,23 @@
const branch = path("js/branch");
let lib;
function validateCurrentBranch(dp) {
if (branch.isNonStandard(dp.branch.current)) {
throw `invalid base branch: ${dp.branch.current}`;
} else {
return dp;
}
}
function validateFeatureName(dp) {
if (branch.isStandard(commander.featureName())) {
throw `invalid feature branch: ${commander.featureName()}`;
} else {
return dp;
}
}
lib = { validateCurrentBranch, validateFeatureName };
module.exports = lib;