build(deps-dev): bump @types/node
[poolifier.git] / src / deque.ts
index 723f1a4950688bcea0244e83a8f764b02cdf5a38..fe82a79896a08757e3f261b66aa364b1407ab6e9 100644 (file)
@@ -79,7 +79,7 @@ export class Deque<T> {
       return
     }
     const tail = this.tail
-    this.tail = (this.tail as Node<T>).prev
+    this.tail = this.tail?.prev
     if (this.tail == null) {
       delete this.head
     } else {
@@ -106,7 +106,7 @@ export class Deque<T> {
       delete this.head.prev
     }
     --this.size
-    return head?.data
+    return head.data
   }
 
   /**
@@ -155,7 +155,7 @@ export class Deque<T> {
           value: node.data,
           done: false
         }
-        node = node.next as Node<T>
+        node = node.next
         return ret
       }
     }
@@ -183,7 +183,7 @@ export class Deque<T> {
               value: node.data,
               done: false
             }
-            node = node.prev as Node<T>
+            node = node.prev
             return ret
           }
         }