Compare commits
3 Commits
v0.1.0-dev
...
v0.1.0-dev
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | 3c806abac0 | |
Derrick Hammer | 149c725624 | |
Derrick Hammer | e110f8f197 |
|
@ -1,3 +1,5 @@
|
||||||
|
# [0.1.0-develop.5](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.4...v0.1.0-develop.5) (2023-08-31)
|
||||||
|
|
||||||
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-08-31)
|
# [0.1.0-develop.4](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.3...v0.1.0-develop.4) (2023-08-31)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.4",
|
"version": "0.1.0-develop.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.4",
|
"version": "0.1.0-develop.5",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
|
"detect-node": "^2.1.0",
|
||||||
"level": "^8.0.0",
|
"level": "^8.0.0",
|
||||||
"multiformats": "^12.0.1",
|
"multiformats": "^12.0.1",
|
||||||
"p-defer": "^4.0.0",
|
"p-defer": "^4.0.0",
|
||||||
|
@ -5971,6 +5972,11 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/detect-node": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g=="
|
||||||
|
},
|
||||||
"node_modules/diff": {
|
"node_modules/diff": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lumeweb/libs5",
|
"name": "@lumeweb/libs5",
|
||||||
"version": "0.1.0-develop.4",
|
"version": "0.1.0-develop.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@noble/curves": "^1.1.0",
|
"@noble/curves": "^1.1.0",
|
||||||
"@noble/hashes": "^1.3.1",
|
"@noble/hashes": "^1.3.1",
|
||||||
|
"detect-node": "^2.1.0",
|
||||||
"level": "^8.0.0",
|
"level": "^8.0.0",
|
||||||
"multiformats": "^12.0.1",
|
"multiformats": "^12.0.1",
|
||||||
"p-defer": "^4.0.0",
|
"p-defer": "^4.0.0",
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { URL } from "url";
|
||||||
import { TcpPeer } from "#transports/tcp.js";
|
import { TcpPeer } from "#transports/tcp.js";
|
||||||
import { WebSocketPeer } from "#transports/webSocket.js";
|
import { WebSocketPeer } from "#transports/webSocket.js";
|
||||||
import { PeerStatic } from "#types.js";
|
import { PeerStatic } from "#types.js";
|
||||||
|
import isNode from "detect-node";
|
||||||
const transports = new Map<string, PeerStatic>();
|
const transports = new Map<string, PeerStatic>();
|
||||||
|
|
||||||
export function registerTransport(type: string, transport: PeerStatic) {
|
export function registerTransport(type: string, transport: PeerStatic) {
|
||||||
|
@ -37,6 +37,8 @@ export function createTransportPeer(
|
||||||
return new transport(socket, connectionUris);
|
return new transport(socket, connectionUris);
|
||||||
}
|
}
|
||||||
|
|
||||||
registerTransport("tcp", TcpPeer);
|
if (isNode) {
|
||||||
|
registerTransport("tcp", TcpPeer);
|
||||||
|
}
|
||||||
registerTransport("ws", WebSocketPeer);
|
registerTransport("ws", WebSocketPeer);
|
||||||
registerTransport("wss", WebSocketPeer);
|
registerTransport("wss", WebSocketPeer);
|
||||||
|
|
Loading…
Reference in New Issue