mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 03:05:38 -05:00
16 lines
415 B
JavaScript
16 lines
415 B
JavaScript
// REQUIRES INTEGRATION TEST
|
|
/* c8 ignore start */
|
|
const workerHooks = [
|
|
["beforeRun", "codeBeforeRunWorker"],
|
|
["beforeRunAsync", "codeBeforeRunWorkerAsync"],
|
|
["afterRun", "codeAfterRunWorker"],
|
|
["afterRunAsync", "codeAfterRunWorkerAsync"],
|
|
];
|
|
|
|
export class Hook {
|
|
constructor(fields) {
|
|
for (const [key, value] of workerHooks) this[key] = fields[value]?.();
|
|
}
|
|
}
|
|
/* c8 ignore stop */
|