Skip to content

Commit

Permalink
Update: Replace lodash.assignWith with object.defaults (closes #29)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jun 26, 2017
1 parent d4f229f commit 74d9e1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
var chokidar = require('chokidar');
var debounce = require('lodash.debounce');
var asyncDone = require('async-done');
var assignWith = require('lodash.assignwith');
var defaults = require('object.defaults');

function assignNullish(objValue, srcValue) {
return (srcValue == null ? objValue : srcValue);
}

var defaults = {
var defaultOpts = {
delay: 200,
events: ['add', 'change', 'unlink'],
ignoreInitial: true,
Expand All @@ -22,7 +18,7 @@ function watch(glob, options, cb) {
options = {};
}

var opt = assignWith({}, defaults, options, assignNullish);
var opt = defaults({}, options, defaultOpts);

if (!Array.isArray(opt.events)) {
opt.events = [opt.events];
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"dependencies": {
"async-done": "^1.2.0",
"chokidar": "^1.4.3",
"lodash.assignwith": "^4.0.6",
"lodash.debounce": "^4.0.6"
"lodash.debounce": "^4.0.6",
"object.defaults": "^1.0.0"
},
"devDependencies": {
"coveralls": "^2.11.2",
Expand Down

0 comments on commit 74d9e1e

Please sign in to comment.