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

@libp2p/interface-peer-store

Package Overview
Dependencies
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/interface-peer-store - npm Package Compare versions

Comparing version 2.0.3 to 2.0.4

25

dist/src/index.d.ts

@@ -104,2 +104,23 @@ import type { PeerId } from '@libp2p/interface-peer-id';

}
/**
* A predicate by which to filter lists of peers
*/
export interface PeerQueryFilter {
(peer: Peer): boolean;
}
/**
* A predicate by which to sort lists of peers
*/
export interface PeerQueryOrder {
(a: Peer, b: Peer): -1 | 0 | 1;
}
/**
* A query for getting lists of peers
*/
export interface PeerQuery {
filters?: PeerQueryFilter[];
orders?: PeerQueryOrder[];
limit?: number;
offset?: number;
}
export interface PeerStore {

@@ -121,3 +142,3 @@ /**

*/
forEach: (fn: (peer: Peer) => void) => Promise<void>;
forEach: (fn: (peer: Peer) => void, query?: PeerQuery) => Promise<void>;
/**

@@ -134,3 +155,3 @@ * Returns all peers in the peer store.

*/
all: () => Promise<Peer[]>;
all: (query?: PeerQuery) => Promise<Peer[]>;
/**

@@ -137,0 +158,0 @@ * Delete all data stored for the passed peer

@@ -5,2 +5,5 @@ {

"PeerData": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.PeerData.html",
"PeerQuery": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.PeerQuery.html",
"PeerQueryFilter": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.PeerQueryFilter.html",
"PeerQueryOrder": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.PeerQueryOrder.html",
"PeerStore": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.PeerStore.html",

@@ -7,0 +10,0 @@ "Tag": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_libp2p._internal_.Tag.html",

2

package.json
{
"name": "@libp2p/interface-peer-store",
"version": "2.0.3",
"version": "2.0.4",
"description": "Peer Store interface for libp2p",

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

@@ -123,2 +123,22 @@ import type { PeerId } from '@libp2p/interface-peer-id'

/**
* A predicate by which to filter lists of peers
*/
export interface PeerQueryFilter { (peer: Peer): boolean }
/**
* A predicate by which to sort lists of peers
*/
export interface PeerQueryOrder { (a: Peer, b: Peer): -1 | 0 | 1 }
/**
* A query for getting lists of peers
*/
export interface PeerQuery {
filters?: PeerQueryFilter[]
orders?: PeerQueryOrder[]
limit?: number
offset?: number
}
export interface PeerStore {

@@ -140,3 +160,3 @@ /**

*/
forEach: (fn: (peer: Peer) => void) => Promise<void>
forEach: (fn: (peer: Peer) => void, query?: PeerQuery) => Promise<void>

@@ -154,3 +174,3 @@ /**

*/
all: () => Promise<Peer[]>
all: (query?: PeerQuery) => Promise<Peer[]>

@@ -157,0 +177,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