sindresorhus / p-queue

Promise queue with concurrency control

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

If `throwOnTimeout` is `false` - `add()` resolves to undefined

indutny-signal opened this issue · comments

As the title claims the add() method of a p-queue instance will return undefined on timeout and this may not be an issue by itself, if not for the fact that the type declarations make it look like undefined can never be returned:

    add<TaskResultType>(fn: Task<TaskResultType>, options?: Partial<EnqueueOptionsType>): Promise<TaskResultType>;