@libp2p/topology
Advanced tools
Comparing version 4.0.2 to 4.0.3-3dfc236e
(function (root, factory) {(typeof module === 'object' && module.exports) ? module.exports = factory() : root.Libp2PTopology = factory()}(typeof self !== 'undefined' ? self : this, function () { | ||
"use strict";var Libp2PTopology=(()=>{var r=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var a=(t,o)=>{for(var e in o)r(t,e,{get:o[e],enumerable:!0})},m=(t,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of p(o))!y.call(t,n)&&n!==e&&r(t,n,{get:()=>o[n],enumerable:!(i=g(o,n))||i.enumerable});return t};var u=t=>m(r({},"__esModule",{value:!0}),t);var b={};a(b,{createTopology:()=>S});var s=Symbol.for("@libp2p/topology");var l=()=>{},c=class{constructor(o){this.min=o.min??0,this.max=o.max??1/0,this.peers=new Set,this.onConnect=o.onConnect??l,this.onDisconnect=o.onDisconnect??l}get[Symbol.toStringTag](){return s.toString()}get[s](){return!0}async setRegistrar(o){this.registrar=o}disconnect(o){this.onDisconnect(o)}};function S(t){return new c(t)}return u(b);})(); | ||
"use strict";var Libp2PTopology=(()=>{var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var g=(n,o)=>{for(var e in o)r(n,e,{get:o[e],enumerable:!0})},y=(n,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of m(o))!p.call(n,t)&&t!==e&&r(n,t,{get:()=>o[t],enumerable:!(i=a(o,t))||i.enumerable});return n};var u=n=>y(r({},"__esModule",{value:!0}),n);var b={};g(b,{createTopology:()=>S});var s=Symbol.for("@libp2p/topology");var l=()=>{},c=class{min;max;peers;onConnect;onDisconnect;registrar;constructor(o){this.min=o.min??0,this.max=o.max??1/0,this.peers=new Set,this.onConnect=o.onConnect??l,this.onDisconnect=o.onDisconnect??l}get[Symbol.toStringTag](){return s.toString()}[s]=!0;async setRegistrar(o){this.registrar=o}disconnect(o){this.onDisconnect(o)}};function S(n){return new c(n)}return u(b);})(); | ||
return Libp2PTopology})); |
import { topologySymbol as symbol } from '@libp2p/interface-registrar'; | ||
const noop = () => { }; | ||
class TopologyImpl { | ||
min; | ||
max; | ||
/** | ||
* Set of peers that support the protocol | ||
*/ | ||
peers; | ||
onConnect; | ||
onDisconnect; | ||
registrar; | ||
constructor(init) { | ||
@@ -14,5 +23,3 @@ this.min = init.min ?? 0; | ||
} | ||
get [symbol]() { | ||
return true; | ||
} | ||
[symbol] = true; | ||
async setRegistrar(registrar) { | ||
@@ -19,0 +26,0 @@ this.registrar = registrar; |
112
package.json
{ | ||
"name": "@libp2p/topology", | ||
"version": "4.0.2", | ||
"version": "4.0.3-3dfc236e", | ||
"description": "libp2p network topology", | ||
"license": "Apache-2.0 OR MIT", | ||
"homepage": "https://github.com/libp2p/js-libp2p-topology#readme", | ||
"homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/topology#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/libp2p/js-libp2p-topology.git" | ||
"url": "git+https://github.com/libp2p/js-libp2p.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/libp2p/js-libp2p-topology/issues" | ||
"url": "https://github.com/libp2p/js-libp2p/issues" | ||
}, | ||
@@ -18,6 +18,2 @@ "keywords": [ | ||
], | ||
"engines": { | ||
"node": ">=16.0.0", | ||
"npm": ">=7.0.0" | ||
}, | ||
"type": "module", | ||
@@ -63,87 +59,2 @@ "types": "./dist/src/index.d.ts", | ||
}, | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ | ||
"breaking": true, | ||
"release": "major" | ||
}, | ||
{ | ||
"revert": true, | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "feat", | ||
"release": "minor" | ||
}, | ||
{ | ||
"type": "fix", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "deps", | ||
"release": "patch" | ||
}, | ||
{ | ||
"scope": "no-release", | ||
"release": false | ||
} | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Documentation" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "Dependencies" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
}, | ||
"scripts": { | ||
@@ -153,15 +64,14 @@ "clean": "aegir clean", | ||
"dep-check": "aegir dep-check", | ||
"build": "aegir build", | ||
"release": "aegir release", | ||
"docs": "aegir docs" | ||
"build": "aegir build" | ||
}, | ||
"dependencies": { | ||
"@libp2p/interface-peer-id": "^2.0.0", | ||
"@libp2p/interface-registrar": "^2.0.3", | ||
"@libp2p/logger": "^2.0.1", | ||
"it-all": "^3.0.1" | ||
"@libp2p/interface-peer-id": "2.0.2-3dfc236e", | ||
"@libp2p/interface-registrar": "2.0.12-3dfc236e" | ||
}, | ||
"devDependencies": { | ||
"aegir": "^37.5.3" | ||
"aegir": "^39.0.10" | ||
}, | ||
"typedoc": { | ||
"entryPoint": "./src/index.ts" | ||
} | ||
} |
@@ -5,4 +5,4 @@ # @libp2p/topology <!-- omit in toc --> | ||
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io) | ||
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-topology.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-topology) | ||
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-topology/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-topology/actions/workflows/js-test-and-release.yml?query=branch%3Amaster) | ||
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p) | ||
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amaster) | ||
@@ -35,3 +35,3 @@ > libp2p network topology | ||
- <https://libp2p.github.io/js-libp2p-topology> | ||
- <https://libp2p.github.io/js-libp2p/modules/_libp2p_topology.html> | ||
@@ -38,0 +38,0 @@ ## License |
@@ -5,3 +5,3 @@ import { topologySymbol as symbol } from '@libp2p/interface-registrar' | ||
const noop = () => {} | ||
const noop = (): void => {} | ||
@@ -30,11 +30,9 @@ class TopologyImpl implements Topology { | ||
get [Symbol.toStringTag] () { | ||
get [Symbol.toStringTag] (): string { | ||
return symbol.toString() | ||
} | ||
get [symbol] () { | ||
return true | ||
} | ||
readonly [symbol] = true | ||
async setRegistrar (registrar: Registrar) { | ||
async setRegistrar (registrar: Registrar): Promise<void> { | ||
this.registrar = registrar | ||
@@ -46,3 +44,3 @@ } | ||
*/ | ||
disconnect (peerId: PeerId) { | ||
disconnect (peerId: PeerId): void { | ||
this.onDisconnect(peerId) | ||
@@ -49,0 +47,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
2
82
7913
9
2
+ Added@libp2p/interface-connection@5.1.1-3dfc236e(transitive)
+ Added@libp2p/interface-peer-id@2.0.2-3dfc236e(transitive)
+ Added@libp2p/interface-registrar@2.0.12-3dfc236e(transitive)
+ Added@libp2p/interfaces@3.3.2-3dfc236e(transitive)
- Removed@libp2p/logger@^2.0.1
- Removedit-all@^3.0.1
- Removed@libp2p/interface-connection@5.1.1(transitive)
- Removed@libp2p/interface-peer-id@2.0.2(transitive)
- Removed@libp2p/interface-registrar@2.0.12(transitive)
- Removed@libp2p/interfaces@3.3.2(transitive)
- Removed@libp2p/logger@2.1.1(transitive)
- Removeddebug@4.4.0(transitive)
- Removedinterface-datastore@8.3.1(transitive)
- Removedinterface-store@6.0.2(transitive)
- Removedit-all@3.0.6(transitive)
- Removedms@2.1.3(transitive)