mirror of
https://gitlab.rlp.net/proj-wise2526-video2document/video2document.git
synced 2026-06-15 18:01:52 +02:00
16 lines
622 B
JavaScript
16 lines
622 B
JavaScript
module.exports = {
|
|
name:"module-handler", // Unique name for our function that will later be used to get the function from the map via "mapFunctions.get("example").function()"
|
|
async function(module,parameter){
|
|
return new Promise(async (resolve, reject) => {
|
|
if(mapFunctions.get(module) == undefined){
|
|
reject("requested modules not found")
|
|
return
|
|
}
|
|
mapFunctions.get(module).function(parameter).then((result) => {
|
|
resolve(result)
|
|
}).catch((err) => {
|
|
reject(err)
|
|
});
|
|
})
|
|
}
|
|
} |