@nsshunt/ststestrunner 1.0.31 → 1.0.32
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.
package/dist/ststestrunner.mjs
CHANGED
|
@@ -20355,19 +20355,10 @@ class ServiceInstance {
|
|
|
20355
20355
|
for (const [event, handler] of Object.entries(handlers)) {
|
|
20356
20356
|
const wrappedHandler = async (...args) => {
|
|
20357
20357
|
if (typeof args.at(-1) === "function") {
|
|
20358
|
-
|
|
20359
|
-
|
|
20360
|
-
try {
|
|
20361
|
-
const result = await handler(...inputArgs);
|
|
20362
|
-
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = [${JSON.stringify(result, null, 2)}]`));
|
|
20363
|
-
cb(__privateGet(this, _EmitEvent).call(this, event, result));
|
|
20364
|
-
} catch (err) {
|
|
20365
|
-
__privateGet(this, _error2).call(this, `${logPrefix} error in ${event}: ${err}`);
|
|
20366
|
-
__privateGet(this, _error2).call(this, chalk$1.red(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)} = Error: [${err}]`));
|
|
20367
|
-
cb({ error: err instanceof Error ? err.message : String(err) });
|
|
20368
|
-
}
|
|
20358
|
+
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event} (with callback): ${JSON.stringify(args, null, 2)}`));
|
|
20359
|
+
return handler(...args);
|
|
20369
20360
|
} else {
|
|
20370
|
-
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args)}`));
|
|
20361
|
+
__privateGet(this, _debug5).call(this, chalk$1.yellow(`${logPrefix} --> ${event}: ${JSON.stringify(args, null, 2)}`));
|
|
20371
20362
|
return handler(...args);
|
|
20372
20363
|
}
|
|
20373
20364
|
};
|