mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
refactor: shorter require
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user