X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fqueue.ts;h=7682f65f952136743c1f81724a26e53264ac18ed;hb=027c221543826da4df348775499148557d3d437e;hp=ab606547b1f77fb08ab6b203e0053ad182b481e6;hpb=c318eb2fef152bf66b27694ccd5ccfd83d20d10d;p=poolifier.git diff --git a/src/queue.ts b/src/queue.ts index ab606547..7682f65f 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -55,4 +55,12 @@ export class Queue { } return item } + + /** + * Peek at the first item. + */ + public peek (): T | undefined { + if (this.size <= 0) return undefined + return this.items[this.head] + } }