gruntjs / gruntjs/grunt

Allow for optional merging of Object type option props

Open
#738 6 comments 0 reactions 0 assignees View on GitHub
Component: tasks Type: Enhancement
Dominant language
JavaScript
Stars
12.2k
Forks
1.5k
PR merge metrics
No merged PRs in 30d

Description

Augment `this.options()` method with one more argument to allow for properties of type Object to merge instead of overwrite.

case:

``` js
multiTask: {
options: {
anObject: {
a: 1
}
},
target: {
options: {
anObject: {
b: 2
}
}
}
}

// in the task
grunt.registerMultiTask('multiTask', function() {
var options = this.options({}, true);

// desired result
// options.anObject === {a:1, b:2}

});
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.