refactor: shorter require

isekai-main
Barış Soner Uşaklı 3 years ago
parent 96f13e4f5d
commit 41c3eb8298

@ -115,10 +115,9 @@ app.flags = {};
}; };
app.require = async (modules) => { // allows you to await require.js modules app.require = async (modules) => { // allows you to await require.js modules
let single = false; const single = !Array.isArray(modules);
if (!Array.isArray(modules)) { if (single) {
modules = [modules]; modules = [modules];
single = true;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

Loading…
Cancel
Save