Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@libp2p/peer-collections

Package Overview
Dependencies
Maintainers
4
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/peer-collections - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

6

dist/src/index.d.ts

@@ -1,4 +0,4 @@

export { PeerMap, peerMap } from './map.js';
export { PeerSet, peerSet } from './set.js';
export { PeerList, peerList } from './list.js';
export { PeerMap } from './map.js';
export { PeerSet } from './set.js';
export { PeerList } from './list.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,4 +0,4 @@

export { PeerMap, peerMap } from './map.js';
export { PeerSet, peerSet } from './set.js';
export { PeerList, peerList } from './list.js';
export { PeerMap } from './map.js';
export { PeerSet } from './set.js';
export { PeerList } from './list.js';
//# sourceMappingURL=index.js.map

@@ -29,3 +29,2 @@ import type { PeerId } from '@libp2p/interfaces/peer-id';

}
export declare function peerList(map?: PeerList): PeerList;
//# sourceMappingURL=list.d.ts.map

@@ -107,5 +107,2 @@ import { peerIdFromString } from '@libp2p/peer-id';

}
export function peerList(map) {
return new PeerList(map);
}
//# sourceMappingURL=list.js.map

@@ -25,3 +25,2 @@ import type { PeerId } from '@libp2p/interfaces/peer-id';

}
export declare function peerMap<T>(map?: PeerMap<T>): PeerMap<T>;
//# sourceMappingURL=map.d.ts.map

@@ -60,5 +60,2 @@ import { peerIdFromString } from '@libp2p/peer-id';

}
export function peerMap(map) {
return new PeerMap(map);
}
//# sourceMappingURL=map.js.map

@@ -12,3 +12,3 @@ import type { PeerId } from '@libp2p/interfaces/peer-id';

private readonly set;
constructor(set?: PeerSet);
constructor(set?: PeerSet | Iterable<PeerId>);
get size(): number;

@@ -20,6 +20,6 @@ [Symbol.iterator](): IterableIterator<PeerId>;

entries(): IterableIterator<[PeerId, PeerId]>;
forEach(predicate: (peerId: PeerId, index: PeerId, set: PeerSet) => void): void;
has(peer: PeerId): boolean;
values(): IterableIterator<PeerId>;
}
export declare function peerSet(set?: PeerSet): PeerSet;
//# sourceMappingURL=set.d.ts.map

@@ -41,2 +41,8 @@ import { peerIdFromString } from '@libp2p/peer-id';

}
forEach(predicate) {
this.set.forEach((str) => {
const id = peerIdFromString(str);
predicate(id, id, this);
});
}
has(peer) {

@@ -51,5 +57,2 @@ return this.set.has(peer.toString());

}
export function peerSet(set) {
return new PeerSet(set);
}
//# sourceMappingURL=set.js.map
{
"name": "@libp2p/peer-collections",
"version": "0.0.0",
"version": "1.0.0",
"description": "Stores values against a peer id",

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

@@ -1,3 +0,3 @@

export { PeerMap, peerMap } from './map.js'
export { PeerSet, peerSet } from './set.js'
export { PeerList, peerList } from './list.js'
export { PeerMap } from './map.js'
export { PeerSet } from './set.js'
export { PeerList } from './list.js'

@@ -146,5 +146,1 @@ import type { PeerId } from '@libp2p/interfaces/peer-id'

}
export function peerList (map?: PeerList): PeerList {
return new PeerList(map)
}

@@ -82,5 +82,1 @@ import type { PeerId } from '@libp2p/interfaces/peer-id'

}
export function peerMap <T> (map?: PeerMap<T>): PeerMap<T> {
return new PeerMap(map)
}

@@ -16,3 +16,3 @@ import type { PeerId } from '@libp2p/interfaces/peer-id'

constructor (set?: PeerSet) {
constructor (set?: PeerSet | Iterable<PeerId>) {
this.set = new Set()

@@ -58,2 +58,10 @@

forEach (predicate: (peerId: PeerId, index: PeerId, set: PeerSet) => void): void {
this.set.forEach((str) => {
const id = peerIdFromString(str)
predicate(id, id, this)
})
}
has (peer: PeerId): boolean {

@@ -72,5 +80,1 @@ return this.set.has(peer.toString())

}
export function peerSet (set?: PeerSet): PeerSet {
return new PeerSet(set)
}

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

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