mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-30 17:54:28 +02:00
its all there baby
This commit is contained in:
parent
eba8734667
commit
13b616bd04
5 changed files with 182 additions and 152 deletions
|
@ -22,20 +22,24 @@ exports.splitTextCommand = function(value, func, context) {
|
|||
});
|
||||
};
|
||||
|
||||
util.genParseCommand = function(regexMap, eventName) {
|
||||
exports.genParseCommand = function(regexMap, eventName) {
|
||||
return function(str) {
|
||||
var method;
|
||||
var regexResults;
|
||||
|
||||
_.each(regexMap, function(regex, _method) {
|
||||
if (regex.test(str)) {
|
||||
var results = regex.exec(str);
|
||||
if (results) {
|
||||
method = _method;
|
||||
regexResults = results;
|
||||
}
|
||||
});
|
||||
|
||||
return (!method) ? false : {
|
||||
toSet: {
|
||||
eventName: 'processLevelBuilderCommand',
|
||||
method: method
|
||||
eventName: eventName,
|
||||
method: method,
|
||||
regexResults: regexResults
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue