This (and the method definition) seem to say that dequeue may return undefined, but when dequeue is actually used this is not the case (because the queue size is checked earlier in that method):
I'm not sure the best way to resolve this so created an issue about it instead. Would dequeue ever be expected to return undefined under normal usage? If not, should its result ever be undefined?
The only line in the project that is "partially covered" is line 37 in
priority-queue.ts
:https://github.com/sindresorhus/p-queue/blob/0131f7f74431c513dbd3817e041e27a54eb50f60/source/priority-queue.ts#L35-L38
This (and the method definition) seem to say that
dequeue
may returnundefined
, but whendequeue
is actually used this is not the case (because the queue size is checked earlier in that method):https://github.com/sindresorhus/p-queue/blob/4b4d2faf265ee7c1625f62c51b2fd5cf6fa6a9af/source/index.ts#L168
I'm not sure the best way to resolve this so created an issue about it instead. Would
dequeue
ever be expected to returnundefined
under normal usage? If not, should its result ever beundefined
?