mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-08-30 06:39:49 +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
|
@ -102,8 +102,10 @@ var commands = {
|
|||
},
|
||||
|
||||
loop: function(callback, context) {
|
||||
_.each(commandConfigs, function(commandConfig, vcs) {
|
||||
_.each(commandConfig, function(config, name) {
|
||||
Object.keys(commandConfigs).forEach(function(vcs) {
|
||||
var commandConfig = commandConfigs[vcs];
|
||||
Object.keys(commandConfig).forEach(function(name) {
|
||||
var config = commandConfig[name];
|
||||
callback(config, name, vcs);
|
||||
});
|
||||
});
|
||||
|
@ -116,8 +118,11 @@ var parse = function(str) {
|
|||
var options;
|
||||
|
||||
// see if we support this particular command
|
||||
_.each(commands.getRegexMap(), function (map, thisVCS) {
|
||||
_.each(map, function(regex, thisMethod) {
|
||||
var regexMap = commands.getRegexMap();
|
||||
Object.keys(regexMap).forEach(function (thisVCS) {
|
||||
var map = regexMap[thisVCS];
|
||||
Object.keys(map).forEach(function(thisMethod) {
|
||||
var regex = map[thisMethod];
|
||||
if (regex.exec(str)) {
|
||||
vcs = thisVCS;
|
||||
method = thisMethod;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue