Skip to content

Commit 1ac9055

Browse files
committed
give up destructure syntax to be compatible with Node.js v4
1 parent 2da0ff4 commit 1ac9055

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ exports.resolve = (modulePath, sourceFile, config) => {
3333
config = {};
3434
}
3535

36-
const { map, extensions } = config;
36+
// in order to be compatible with Node.js v4,
37+
// give up destructure syntax
38+
const map = config.map;
39+
const extensions = config.extensions;
3740
const sourceDir = path.dirname(sourceFile);
3841
let resolvePath = modulePath;
3942

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ exports.resolve = (modulePath, sourceFile, config) => {
3333
config = {};
3434
}
3535

36-
const { map, extensions } = config;
36+
// in order to be compatible with Node.js v4,
37+
// give up destructure syntax
38+
const map = config.map;
39+
const extensions = config.extensions;
3740
const sourceDir = path.dirname(sourceFile);
3841
let resolvePath = modulePath;
3942

0 commit comments

Comments
 (0)