mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +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
|
||||
let single = false;
|
||||
if (!Array.isArray(modules)) {
|
||||
const single = !Array.isArray(modules);
|
||||
if (single) {
|
||||
modules = [modules];
|
||||
single = true;
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user