Skip to content

Commit

Permalink
Update: Replace lodash.* modules (closes #28) (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
aashna956 authored and phated committed Feb 26, 2017
1 parent c72e91a commit 0ff6961
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 20 deletions.
20 changes: 14 additions & 6 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

var assert = require('assert');

var filter = require('lodash.filter');
var map = require('lodash.map');
var flatten = require('lodash.flatten');
var forEach = require('lodash.foreach');
var filter = require('arr-filter');
var map = require('arr-map');
var flatten = require('arr-flatten');
var forEach = require('array-each');

function noop() {}

Expand All @@ -15,6 +15,14 @@ function getExtensions(lastArg) {
}
}

function filterSuccess(elem) {
return elem.state === 'success';
}

function filterError(elem) {
return elem.state === 'error';
}

function buildOnSettled(done) {
if (typeof done !== 'function') {
done = noop;
Expand All @@ -25,8 +33,8 @@ function buildOnSettled(done) {
return done(error, null);
}

var settledErrors = filter(result, { state: 'error' });
var settledResults = filter(result, { state: 'success' });
var settledErrors = filter(result, filterError);
var settledResults = filter(result, filterSuccess);

var errors = null;
if (settledErrors.length) {
Expand Down
4 changes: 2 additions & 2 deletions lib/parallel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var initial = require('lodash.initial');
var last = require('lodash.last');
var initial = require('array-initial');
var last = require('array-last');
var asyncDone = require('async-done');
var nowAndLater = require('now-and-later');

Expand Down
4 changes: 2 additions & 2 deletions lib/series.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var initial = require('lodash.initial');
var last = require('lodash.last');
var initial = require('array-initial');
var last = require('array-last');
var asyncDone = require('async-done');
var nowAndLater = require('now-and-later');

Expand Down
4 changes: 2 additions & 2 deletions lib/settleParallel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var initial = require('lodash.initial');
var last = require('lodash.last');
var initial = require('array-initial');
var last = require('array-last');
var asyncSettle = require('async-settle');
var nowAndLater = require('now-and-later');

Expand Down
4 changes: 2 additions & 2 deletions lib/settleSeries.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var initial = require('lodash.initial');
var last = require('lodash.last');
var initial = require('array-initial');
var last = require('array-last');
var asyncSettle = require('async-settle');
var nowAndLater = require('now-and-later');

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"coveralls": "npm run cover && istanbul-coveralls"
},
"dependencies": {
"arr-filter": "^1.1.1",
"arr-flatten": "^1.0.1",
"arr-map": "^2.0.0",
"array-each": "^1.0.0",
"array-initial": "^1.0.0",
"array-last": "^1.1.1",
"async-done": "^1.2.2",
"async-settle": "^1.0.0",
"lodash.filter": "^4.1.0",
"lodash.flatten": "^4.0.0",
"lodash.foreach": "^4.0.0",
"lodash.initial": "^4.0.1",
"lodash.last": "^3.0.0",
"lodash.map": "^4.1.0",
"now-and-later": "^1.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 0ff6961

Please sign in to comment.