Use 'Object.values' and 'Object.keys' to get list 'keys' and 'values'

This commit is contained in:
Hongarc 2018-12-01 08:51:03 +07:00
parent e17d974b55
commit d87fd095c0
2 changed files with 2 additions and 4 deletions

View file

@ -2090,9 +2090,7 @@ GitEngine.prototype.hgRebase = function(destination, base) {
});
});
var branchList = _.map(branchMap, function(val, id) {
return id;
});
var branchList = Object.keys(branchMap);
chain = chain.then(function() {
// now we just moved a bunch of commits, but we haven't updated the

View file

@ -83,7 +83,7 @@ var Command = Backbone.Model.extend({
}, this);
var newMap = {};
_.each(options, function(args, key) {
newMap[key] = _.map(args, function(arg) {
newMap[key] = Object.values(args).map(function (arg) {
return this.replaceDotWithHead(arg);
}, this);
}, this);