mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-01 02:04:26 +02:00
refactoring
This commit is contained in:
parent
2bee3d357a
commit
eba8734667
6 changed files with 72 additions and 59 deletions
|
@ -22,3 +22,21 @@ exports.splitTextCommand = function(value, func, context) {
|
|||
});
|
||||
};
|
||||
|
||||
util.genParseCommand = function(regexMap, eventName) {
|
||||
return function(str) {
|
||||
var method;
|
||||
|
||||
_.each(regexMap, function(regex, _method) {
|
||||
if (regex.test(str)) {
|
||||
method = _method;
|
||||
}
|
||||
});
|
||||
|
||||
return (!method) ? false : {
|
||||
toSet: {
|
||||
eventName: 'processLevelBuilderCommand',
|
||||
method: method
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue