wearefractal/gulp-util — pull request #8 by lazd (2013-12-10 07:00:59+00:00)
Title: Added extend method

As many Gulp tasks will accept options, it becomes necessary to have a mechanism for setting default options.

`extend` can be used to do this. For instance, the following code could conceivably appear in a Gulp plugin:

```
if (!opt) opt = {};
opt.trueByDefault = typeof opt.trueByDefault !== 'undefined' : opt.trueByDefault : true;
opt.falseByDefault = opt.someOption || false;
opt.someOption = opt.someOption || 'someOption';
```

This could be changed to:

```
opt = gutil.extend({
falseByDefault: false,
trueByDefault: true,
someOption: 'someOption'
}, opt);
```

Passed options will override defaults, and, in the case that `opt` is undefined, `extend` will give the defaults.