yocto-queue
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -51,2 +51,9 @@ export default class Queue<ValueType> implements Iterable<ValueType> { | ||
/** | ||
Get the next value in the queue without removing it. | ||
@returns The value or `undefined` if the queue is empty. | ||
*/ | ||
peek(): ValueType | undefined; | ||
/** | ||
Clear the queue. | ||
@@ -53,0 +60,0 @@ */ |
@@ -49,2 +49,6 @@ /* | ||
peek() { | ||
return this.#head?.value; | ||
} | ||
clear() { | ||
@@ -51,0 +55,0 @@ this.#head = undefined; |
{ | ||
"name": "yocto-queue", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Tiny queue data structure", | ||
@@ -15,2 +15,4 @@ "license": "MIT", | ||
"exports": "./index.js", | ||
"types": "./index.d.ts", | ||
"sideEffects": false, | ||
"engines": { | ||
@@ -17,0 +19,0 @@ "node": ">=12.20" |
@@ -11,5 +11,5 @@ # yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue) | ||
```sh | ||
npm install yocto-queue | ||
``` | ||
$ npm install yocto-queue | ||
``` | ||
@@ -55,2 +55,8 @@ ## Usage | ||
#### `.peek()` | ||
Get the next value in the queue without removing it. | ||
Returns the value or `undefined` if the queue is empty. | ||
#### `.clear()` | ||
@@ -57,0 +63,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6782
104
71