summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFederico Brigante <github@bfred.it>2018-04-19 18:10:56 +0700
committerFederico Brigante <github@bfred.it>2018-04-19 18:33:23 +0700
commit6ad020d6222da759c127c416f599a29b01e722bc (patch)
treeb9248caface4b22760be7026040d838526c2e49b /lib
parentf92456727c70f293eea39315ede5d9402fa1b38b (diff)
downloadasync-6ad020d6222da759c127c416f599a29b01e722bc.tar.gz
Drop arrayMap
Diffstat (limited to 'lib')
-rw-r--r--lib/autoInject.js3
-rw-r--r--lib/internal/filter.js5
-rw-r--r--lib/reflectAll.js3
-rw-r--r--lib/seq.js3
-rw-r--r--lib/sortBy.js4
5 files changed, 6 insertions, 12 deletions
diff --git a/lib/autoInject.js b/lib/autoInject.js
index ff635f9..65b2cfb 100644
--- a/lib/autoInject.js
+++ b/lib/autoInject.js
@@ -1,5 +1,4 @@
import auto from './auto';
-import arrayMap from 'lodash/_arrayMap';
import forOwn from './internal/forOwn';
import wrapAsync from './internal/wrapAsync';
import { isAsync } from './internal/wrapAsync';
@@ -132,7 +131,7 @@ export default function autoInject(tasks, callback) {
}
function newTask(results, taskCb) {
- var newArgs = arrayMap(params, function (name) {
+ var newArgs = params.map(function (name) {
return results[name];
});
newArgs.push(taskCb);
diff --git a/lib/internal/filter.js b/lib/internal/filter.js
index 0e6ced4..74d7ab4 100644
--- a/lib/internal/filter.js
+++ b/lib/internal/filter.js
@@ -1,4 +1,3 @@
-import arrayMap from 'lodash/_arrayMap';
import isArrayLike from 'lodash.isarraylike';
import property from './property';
import noop from './noop';
@@ -39,9 +38,9 @@ function filterGeneric(eachfn, coll, iteratee, callback) {
if (err) {
callback(err);
} else {
- callback(null, arrayMap(results.sort(function (a, b) {
+ callback(null, results.sort(function (a, b) {
return a.index - b.index;
- }), property('value')));
+ }).map(property('value')));
}
});
}
diff --git a/lib/reflectAll.js b/lib/reflectAll.js
index 8e4b3c3..3f078dc 100644
--- a/lib/reflectAll.js
+++ b/lib/reflectAll.js
@@ -1,5 +1,4 @@
import reflect from './reflect';
-import _arrayMap from 'lodash/_arrayMap';
import forOwn from './internal/forOwn';
/**
@@ -72,7 +71,7 @@ import forOwn from './internal/forOwn';
export default function reflectAll(tasks) {
var results;
if (Array.isArray(tasks)) {
- results = _arrayMap(tasks, reflect);
+ results = tasks.map(reflect);
} else {
results = {};
forOwn(tasks, function(task, key) {
diff --git a/lib/seq.js b/lib/seq.js
index 5162028..5672195 100644
--- a/lib/seq.js
+++ b/lib/seq.js
@@ -2,7 +2,6 @@ import noop from './internal/noop';
import slice from './internal/slice';
import reduce from './reduce';
import wrapAsync from './internal/wrapAsync';
-import arrayMap from 'lodash/_arrayMap';
/**
* Version of the compose function that is more natural to read. Each function
@@ -43,7 +42,7 @@ import arrayMap from 'lodash/_arrayMap';
* });
*/
export default function seq(/*...functions*/) {
- var _functions = arrayMap(arguments, wrapAsync);
+ var _functions = Array.prototype.map.call(arguments, wrapAsync);
return function(/*...args*/) {
var args = slice(arguments);
var that = this;
diff --git a/lib/sortBy.js b/lib/sortBy.js
index 0c3648c..85028b2 100644
--- a/lib/sortBy.js
+++ b/lib/sortBy.js
@@ -1,5 +1,3 @@
-import arrayMap from 'lodash/_arrayMap';
-
import map from './map';
import wrapAsync from './internal/wrapAsync';
import property from './internal/property';
@@ -60,7 +58,7 @@ export default function sortBy (coll, iteratee, callback) {
});
}, function (err, results) {
if (err) return callback(err);
- callback(null, arrayMap(results.sort(comparator), property('value')));
+ callback(null, results.sort(comparator).map(property('value')));
});
function comparator(left, right) {