Skip to content

Commit c344710

Browse files
vladimyragnivade
authored andcommitted
Use Promise.all + Array#map instead of p-map
1 parent 1ea5f9b commit c344710

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

lib/utils.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require('fs-extra');
22
const path = require('path');
33
const glob = require('glob');
44
const flatten = require('lodash/flatten');
5-
const promiseMap = require('p-map');
65

76
module.exports = {
87
parsePlatform(pagefile) {
@@ -25,18 +24,18 @@ module.exports = {
2524
};
2625
},
2726

28-
walk(dir) {
27+
walk: function walk(dir) {
2928
return fs.readdir(dir)
3029
.then((items) => {
31-
return promiseMap(items, (item) => {
30+
return Promise.all(items.map((item) => {
3231
const itemPath = path.join(dir, item);
3332
return fs.stat(itemPath).then((stat) => {
3433
if (stat.isDirectory()) {
35-
return this.walk(itemPath);
34+
return walk(itemPath);
3635
}
3736
return path.join(path.basename(dir), item);
3837
});
39-
});
38+
}));
4039
})
4140
.then((paths) => {
4241
return flatten(paths);

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
"natural": "^0.5.4",
5858
"ora": "^2.0.0",
5959
"os-homedir": "^1.0.1",
60-
"p-map": "^1.2.0",
6160
"request": "^2.75.0",
6261
"unzip2": "^0.2.5"
6362
},

0 commit comments

Comments
 (0)