mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-08 13:44:25 +02:00
Use 'Object.values' and 'Object.keys' instead of '_.each(object)'
This commit is contained in:
parent
bd8009386d
commit
96ddb5041a
9 changed files with 52 additions and 33 deletions
|
@ -406,8 +406,9 @@ var Level = Sandbox.extend({
|
|||
}
|
||||
|
||||
var matched = false;
|
||||
_.each(Commands.commands.getCommandsThatCount(), function(map) {
|
||||
_.each(map, function(regex) {
|
||||
var commandsThatCount = Commands.commands.getCommandsThatCount();
|
||||
Object.values(commandsThatCount).forEach(function(map) {
|
||||
Object.values(map).forEach(function(regex) {
|
||||
matched = matched || regex.test(command.get('rawStr'));
|
||||
});
|
||||
});
|
||||
|
|
|
@ -75,8 +75,10 @@ ParseWaterfall.prototype.expandAllShortcuts = function(commandStr) {
|
|||
};
|
||||
|
||||
ParseWaterfall.prototype.expandShortcut = function(commandStr, shortcutMap) {
|
||||
_.each(shortcutMap, function(map, vcs) {
|
||||
_.each(map, function(regex, method) {
|
||||
Object.keys(shortcutMap).forEach(function(vcs) {
|
||||
var map = shortcutMap[vcs];
|
||||
Object.keys(map).forEach(function(method) {
|
||||
var regex = map[method];
|
||||
var results = regex.exec(commandStr);
|
||||
if (results) {
|
||||
commandStr = vcs + ' ' + method + ' ' + commandStr.slice(results[0].length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue