2023-08-27 18:21:25 +00:00
|
|
|
var { define, run } = (() => {
|
|
|
|
const modules: Record<string, Function> = {};
|
|
|
|
|
|
|
|
function define(name: string, func: Function) {
|
|
|
|
modules[name] = func;
|
|
|
|
}
|
|
|
|
function run(name: string) {
|
2023-09-04 11:30:57 +00:00
|
|
|
if (typeof modules[name] === 'function') return modules[name]();
|
|
|
|
else throw "The module '" + name + "' doesn't exist.";
|
2023-08-27 18:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return { define, run };
|
|
|
|
})();
|