mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
refactoring
This commit is contained in:
parent
2bee3d357a
commit
eba8734667
6 changed files with 72 additions and 59 deletions
|
@ -55,27 +55,6 @@ var regexMap = {
|
|||
'iosAlert': /^iOS alert($|\s)/
|
||||
};
|
||||
|
||||
var parse = function(str) {
|
||||
var sandboxMethod;
|
||||
var regexResults;
|
||||
|
||||
_.each(regexMap, function(regex, method) {
|
||||
var results = regex.exec(str);
|
||||
if (results) {
|
||||
sandboxMethod = method;
|
||||
regexResults = results;
|
||||
}
|
||||
});
|
||||
|
||||
return (!sandboxMethod) ? false : {
|
||||
toSet: {
|
||||
eventName: 'processSandboxCommand',
|
||||
method: sandboxMethod,
|
||||
regexResults: regexResults
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
exports.instantCommands = instantCommands;
|
||||
exports.parse = parse;
|
||||
exports.parse = util.genParseCommand(regexMap, 'processSandboxCommand');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue