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

@libp2p/utils

Package Overview
Dependencies
Maintainers
6
Versions
615
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/utils - npm Package Compare versions

Comparing version 6.3.1-15a70af5f to 6.3.1-4bbcfa707

6

dist/src/is-async-generator.js
export function isAsyncGenerator(obj) {
if (obj == null)
if (obj == null) {
return false;
}
const asyncIterator = obj?.[Symbol.asyncIterator];
if (typeof asyncIterator !== 'function')
if (typeof asyncIterator !== 'function') {
return false;
}
const instance = obj;

@@ -8,0 +10,0 @@ return typeof instance.next === 'function';

export function isGenerator(obj) {
if (obj == null)
if (obj == null) {
return false;
}
const iterator = obj?.[Symbol.iterator];
if (typeof iterator !== 'function')
if (typeof iterator !== 'function') {
return false;
}
const instance = obj;

@@ -8,0 +10,0 @@ return typeof instance.next === 'function';

{
"name": "@libp2p/utils",
"version": "6.3.1-15a70af5f",
"version": "6.3.1-4bbcfa707",
"description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",

@@ -184,5 +184,5 @@ "license": "Apache-2.0 OR MIT",

"@chainsafe/netmask": "^2.0.0",
"@libp2p/crypto": "5.0.9-15a70af5f",
"@libp2p/interface": "2.4.0-15a70af5f",
"@libp2p/logger": "5.1.6-15a70af5f",
"@libp2p/crypto": "5.0.9-4bbcfa707",
"@libp2p/interface": "2.4.0-4bbcfa707",
"@libp2p/logger": "5.1.6-4bbcfa707",
"@multiformats/multiaddr": "^12.3.3",

@@ -208,3 +208,3 @@ "@sindresorhus/fnv1a": "^3.1.0",

"devDependencies": {
"@libp2p/peer-id": "5.0.10-15a70af5f",
"@libp2p/peer-id": "5.0.10-4bbcfa707",
"@types/netmask": "^2.0.5",

@@ -211,0 +211,0 @@ "aegir": "^45.0.5",

export function isAsyncGenerator (obj: unknown): obj is AsyncGenerator {
if (obj == null) return false
if (obj == null) {
return false
}
const asyncIterator = (obj as { [Symbol.asyncIterator]?: unknown })?.[
Symbol.asyncIterator
]
if (typeof asyncIterator !== 'function') return false
if (typeof asyncIterator !== 'function') {
return false
}
const instance = obj as { next?: unknown }
return typeof instance.next === 'function'
}
export function isGenerator (obj: unknown): obj is Generator {
if (obj == null) return false
if (obj == null) {
return false
}
const iterator = (obj as { [Symbol.iterator]?: unknown })?.[Symbol.iterator]
if (typeof iterator !== 'function') return false
if (typeof iterator !== 'function') {
return false
}
const instance = obj as { next?: unknown }
return typeof instance.next === 'function'
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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