New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@iter-tools/queue

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iter-tools/queue - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

10

lib/__tests__/queue.test.js

@@ -18,2 +18,12 @@ const Queue = require('../queue.cjs');

it('can clear values', () => {
const q = new Queue([1, 2, 3]);
const iter = q[Symbol.iterator]();
q.clear();
expect([...q]).toEqual([]);
expect([...iter]).toEqual([]);
});
it('can shift the values that are pushed to it', () => {

@@ -20,0 +30,0 @@ const q = new Queue();

35

lib/queue.d.ts

@@ -14,53 +14,22 @@ /**

/**
* An optional iterable of `values` to be pushed into the queue
* in sequence. If `null` or `undefined` are passed the queue will
* have no initial values.
*/
constructor(values?: Iterable<T> | null);
/**
* The number of values in the queue
*/
readonly size: number;
/**
* Returns the value at the head of the queue.
*/
clear(): void;
peek(): T | undefined;
/**
* Removes the value at the head of the queue and returns it.
*/
shift(): T | undefined;
/**
* Adds `value` at the tail of the queue.
*/
push(value: T): void;
/**
* Calls `cb(value, index, queue)` for each value in the queue.
*/
forEach(cb: (value: T, index: number, queue: Queue) => any): void;
/**
* Yields sequential 0-based indexes, one for each queued value.
* The index 0 indicates the head.
*/
keys(): IterableIterator<number>;
/**
* Yields the queued values from head to tail.
*/
values(): IterableIterator<T>;
/**
* Yields an `[index,value]` tuple for each value in the list.
*/
entries(): IterableIterator<[number, T]>;
/**
* The default iterator. Equivalent to `values()`.
*/
[Symbol.iterator](): IterableIterator<T>;

@@ -67,0 +36,0 @@ }

{
"name": "@iter-tools/queue",
"version": "1.4.1",
"version": "1.5.0",
"description": "An es6-style iterable queue",

@@ -5,0 +5,0 @@ "main": "lib/queue.cjs",

@@ -55,2 +55,7 @@ # @iter-tools/queue

/**
* Empties the queue of all values.
*/
clear();
/**
* Returns the value at the head of the queue.

@@ -57,0 +62,0 @@ */

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc