X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Futils.ts;h=d8c4c3e905318b3c485991155c65cfdc03f269a7;hb=d3a9c958dcc326062e978f22d88747c00522032d;hp=f88ead7dcbcd238cb990ebaed48e23f625201c4c;hpb=9a38f99e676160c0bc7d28fe88f27b01fa31b5a1;p=poolifier.git diff --git a/src/worker/utils.ts b/src/worker/utils.ts index f88ead7d..d8c4c3e9 100644 --- a/src/worker/utils.ts +++ b/src/worker/utils.ts @@ -1,8 +1,10 @@ -import { isPlainObject } from '../utils' -import type { TaskFunction } from './task-functions' -import { KillBehaviors, type WorkerOptions } from './worker-options' +import { isPlainObject } from '../utils.js' +import type { TaskFunction } from './task-functions.js' +import { KillBehaviors, type WorkerOptions } from './worker-options.js' -export const checkValidWorkerOptions = (opts: WorkerOptions): void => { +export const checkValidWorkerOptions = ( + opts: WorkerOptions | undefined +): void => { if (opts != null && !isPlainObject(opts)) { throw new TypeError('opts worker options parameter is not a plain object') } @@ -28,9 +30,6 @@ export const checkValidWorkerOptions = (opts: WorkerOptions): void => { if (opts?.killHandler != null && typeof opts.killHandler !== 'function') { throw new TypeError('killHandler option is not a function') } - if (opts?.async != null) { - throw new Error('async option is deprecated') - } } export const checkValidTaskFunctionEntry = (