mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +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
|
@ -82,7 +82,8 @@ var Command = Backbone.Model.extend({
|
|||
return this.replaceDotWithHead(arg);
|
||||
}, this);
|
||||
var newMap = {};
|
||||
_.each(options, function(args, key) {
|
||||
Object.keys(options).forEach(function(key) {
|
||||
var args = options[key];
|
||||
newMap[key] = Object.values(args).map(function (arg) {
|
||||
return this.replaceDotWithHead(arg);
|
||||
}, this);
|
||||
|
@ -273,7 +274,8 @@ var Command = Backbone.Model.extend({
|
|||
return false;
|
||||
}
|
||||
|
||||
_.each(results.toSet, function(obj, key) {
|
||||
Object.keys(results.toSet).forEach(function(key) {
|
||||
var obj = results.toSet[key];
|
||||
// data comes back from the parsing functions like
|
||||
// options (etc) that need to be set
|
||||
this.set(key, obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue