node-pluginsmanager-plugin 5.0.9 → 5.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -280,7 +280,16 @@ class Orchestrator extends MediatorUser_1.default {
|
|
|
280
280
|
// load
|
|
281
281
|
return new Promise((resolve, reject) => {
|
|
282
282
|
try {
|
|
283
|
-
|
|
283
|
+
const val = require(this._mediatorFile);
|
|
284
|
+
if ("object" === typeof val && "function" === typeof val.default) {
|
|
285
|
+
resolve(val.default);
|
|
286
|
+
}
|
|
287
|
+
else if ("function" === typeof val) {
|
|
288
|
+
resolve(val);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
reject(new Error("Mediator file loaded (\"" + this._mediatorFile + "\") does not contain a valid Mediator"));
|
|
292
|
+
}
|
|
284
293
|
}
|
|
285
294
|
catch (e) {
|
|
286
295
|
reject(e);
|
|
@@ -306,7 +315,16 @@ class Orchestrator extends MediatorUser_1.default {
|
|
|
306
315
|
// load
|
|
307
316
|
return new Promise((resolve, reject) => {
|
|
308
317
|
try {
|
|
309
|
-
|
|
318
|
+
const val = require(this._serverFile);
|
|
319
|
+
if ("object" === typeof val && "function" === typeof val.default) {
|
|
320
|
+
resolve(val.default);
|
|
321
|
+
}
|
|
322
|
+
else if ("function" === typeof val) {
|
|
323
|
+
resolve(val);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
reject(new Error("Server file loaded (\"" + this._serverFile + "\") does not contain a valid Server"));
|
|
327
|
+
}
|
|
310
328
|
}
|
|
311
329
|
catch (e) {
|
|
312
330
|
reject(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-pluginsmanager-plugin",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.10",
|
|
4
4
|
"description": "An abstract parent plugin for node-pluginsmanager",
|
|
5
5
|
|
|
6
6
|
"type": "commonjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/express": "4.17.13",
|
|
61
|
-
"@types/node": "18.0.
|
|
61
|
+
"@types/node": "18.0.4",
|
|
62
62
|
"@types/socket.io": "3.0.2",
|
|
63
63
|
"@types/uniqid": "5.3.2",
|
|
64
64
|
"@types/ws": "8.5.3",
|