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

it-peekable

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

it-peekable - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

8

dist/src/index.js
function peekable(iterable) {
// @ts-expect-error
// @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
const [iterator, symbol] = iterable[Symbol.asyncIterator] != null
// @ts-expect-error
// @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]
// @ts-expect-error
// @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable
: [iterable[Symbol.iterator](), Symbol.iterator];
const queue = [];
// @ts-expect-error
// @ts-expect-error can't use symbol to index peekable
return {

@@ -11,0 +11,0 @@ peek: () => {

{
"name": "it-peekable",
"version": "3.0.0",
"version": "3.0.1",
"description": "Allows peeking/pushing an iterable",

@@ -138,5 +138,5 @@ "author": "Alex Potsides <alex@achingbrain.net>",

"devDependencies": {
"aegir": "^38.1.7",
"aegir": "^39.0.2",
"it-all": "^3.0.0"
}
}

@@ -21,7 +21,7 @@

function peekable <T> (iterable: Iterable<T> | AsyncIterable<T>): Peekable<T> | AsyncPeekable<T> {
// @ts-expect-error
// @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
const [iterator, symbol] = iterable[Symbol.asyncIterator] != null
// @ts-expect-error
// @ts-expect-error can't use Symbol.asyncIterator to index iterable since it might be Iterable
? [iterable[Symbol.asyncIterator](), Symbol.asyncIterator]
// @ts-expect-error
// @ts-expect-error can't use Symbol.iterator to index iterable since it might be AsyncIterable
: [iterable[Symbol.iterator](), Symbol.iterator]

@@ -31,3 +31,3 @@

// @ts-expect-error
// @ts-expect-error can't use symbol to index peekable
return {

@@ -34,0 +34,0 @@ peek: () => {

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