Skip to content

Commit 25252d6

Browse files
committed
fix(readify) assign name
1 parent ebb5993 commit 25252d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/readdir.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ const superstat = require('superstat');
88
const currify = require('currify');
99

1010
const noop = function() {};
11+
const {assign} = Object;
1112

1213
const stat = currify(async (dir, name) => {
1314
const full = join(dir, name);
14-
const [, info = empty(name)] = await tryToCatch(superstat, full);
15+
const [, info = empty()] = await tryToCatch(superstat, full);
1516

16-
return info;
17+
return assign(info, {
18+
name,
19+
});
1720
});
1821

1922
module.exports = async (dir) => {

0 commit comments

Comments
 (0)