sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.45k stars 185 forks source link

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

Closed indutny-signal closed 1 year ago

indutny-signal commented 2 years ago

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>;