refactoring

This commit is contained in:
Peter Cottle 2013-01-09 00:42:42 -08:00
parent 2bee3d357a
commit eba8734667
6 changed files with 72 additions and 59 deletions

View file

@ -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
}
};
};
};