Commit 298d0c43 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch '34610-Remove-IIFEs-from-new_branch_form.js' into 'master'

Resolve "Remove IIFEs from new_branch_form.js"

Closes #34610

See merge request gitlab-org/gitlab!20009
parents 7f4453f1 85e2b184
......@@ -72,16 +72,14 @@ export default class NewBranchForm {
});
return `${restriction.prefix} ${formatted.join(restriction.conjunction)}`;
};
const validator = (function(_this) {
return function(errors, restriction) {
const matched = _this.name.val().match(restriction.pattern);
if (matched) {
return errors.concat(formatter(matched.reduce(unique, []), restriction));
} else {
return errors;
}
};
})(this);
const validator = (errors, restriction) => {
const matched = this.name.val().match(restriction.pattern);
if (matched) {
return errors.concat(formatter(matched.reduce(unique, []), restriction));
} else {
return errors;
}
};
const errors = this.restrictions.reduce(validator, []);
if (errors.length > 0) {
const errorMessage = $('<span/>').text(errors.join(', '));
......
---
title: Remove IIFEs from new_branch_form.js
merge_request: 20009
author: minghuan lei
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment