Use 'Object.values' and 'Object.keys' instead of '_.each(object)'

This commit is contained in:
Hongarc 2018-12-01 12:33:23 +07:00
parent bd8009386d
commit 96ddb5041a
9 changed files with 52 additions and 33 deletions

View file

@ -139,8 +139,11 @@ var getAllCommands = function() {
require('../level').regexMap,
regexMap
);
_.each(Commands.commands.getRegexMap(), function(map, vcs) {
_.each(map, function(regex, method) {
var mRegexMap = Commands.commands.getRegexMap();
Object.keys(mRegexMap).forEach(function(vcs) {
var map = mRegexMap[vcs];
Object.keys(map).forEach(function(method) {
var regex = map[method];
allCommands[vcs + ' ' + method] = regex;
});
});