fix: fix workey weights input validation
[poolifier.git] / src / queue.ts
index ab606547b1f77fb08ab6b203e0053ad182b481e6..7682f65f952136743c1f81724a26e53264ac18ed 100644 (file)
@@ -55,4 +55,12 @@ export class Queue<T> {
     }
     return item
   }
+
+  /**
+   * Peek at the first item.
+   */
+  public peek (): T | undefined {
+    if (this.size <= 0) return undefined
+    return this.items[this.head]
+  }
 }