Skip to content

Commit 6b1fe02

Browse files
committed
Move to switch/case in loader
1 parent 398dae5 commit 6b1fe02

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

loader.ejs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ if (!self.<%- amdFunctionName %>) {
6666
};
6767
return Promise.all(
6868
depsNames.map(depName => {
69-
// TODO: switch-case?
70-
if (depName === "exports") {
71-
return exports;
69+
switch(depName) {
70+
case "exports":
71+
return exports;
72+
case "module":
73+
return module;
74+
default:
75+
return singleRequire(depName);
7276
}
73-
if (depName === "module") {
74-
return module;
75-
}
76-
return singleRequire(depName);
7777
})
7878
).then(deps => {
7979
const facValue = factory(...deps);

0 commit comments

Comments
 (0)