Commit be1166f
esm: refactor createDynamicModule()
This commit refactors createDynamicModule() for readability:
- The map() callback functions are named and moved to a higher
scope.
- The two export map() loops are combined.
- JSON.stringify() is only called once per import.
PR-URL: #27809
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent a9f9557 commit be1166fCopy full SHA for be1166f
File tree
Expand file treeCollapse file tree
1 file changed
+14
-11
lines changedOpen diff view settings
Filter options
- lib/internal/modules/esm
Expand file treeCollapse file tree
1 file changed
+14
-11
lines changedOpen diff view settings
Collapse file
lib/internal/modules/esm/create_dynamic_module.js
Copy file name to clipboardExpand all lines: lib/internal/modules/esm/create_dynamic_module.js+14-11Lines changed: 14 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
15 | 11 | |
16 | | - |
17 | | - |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
18 | 16 | |
19 | 17 | |
20 | 18 | |
21 | 19 | |
22 | | - |
| 20 | + |
23 | 21 | |
24 | 22 | |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
25 | 28 | |
26 | 29 | |
27 | 30 | |
|
0 commit comments