@hive-p2p/server 1.0.81 → 1.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/config.mjs +3 -2
- package/package.json +1 -1
- package/services/converter.mjs +1 -1
- package/services/cryptos.mjs +1 -1
package/core/config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const isNode = typeof self === 'undefined';
|
|
2
|
-
if (!isNode) (await import('../libs/simplepeer-9.11.1.min.js')).default;
|
|
2
|
+
//if (!isNode) (await import('../libs/simplepeer-9.11.1.min.js')).default;
|
|
3
3
|
|
|
4
4
|
// HOLD: GLOBAL CONFIG FOR THE LIBRARY
|
|
5
5
|
// AVOID: CIRCULAR DEPENDENCIES AND TOO MANY FUNCTION/CONSTRUCTOR CONFIG
|
|
@@ -108,7 +108,8 @@ export const TRANSPORTS = {
|
|
|
108
108
|
|
|
109
109
|
WS_CLIENT: WebSocket,
|
|
110
110
|
WS_SERVER: isNode ? (await import('ws')).WebSocketServer : null,
|
|
111
|
-
PEER: isNode ? (await import('simple-peer')).default : window.SimplePeer
|
|
111
|
+
//PEER: isNode ? (await import('simple-peer')).default : window.SimplePeer
|
|
112
|
+
PEER: (await import('simple-peer')).default,
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
export const DISCOVERY = {
|
package/package.json
CHANGED
package/services/converter.mjs
CHANGED
|
@@ -2,7 +2,7 @@ const base58Alphabet = { '1': 0, '2': 1, '3': 2, '4': 3, '5': 4, '6': 5, '7': 6,
|
|
|
2
2
|
const base58AlphabetArray = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' ];
|
|
3
3
|
|
|
4
4
|
export class Converter {
|
|
5
|
-
IS_BROWSER = typeof
|
|
5
|
+
IS_BROWSER = typeof self !== 'undefined';
|
|
6
6
|
FROMBASE64_AVAILABLE = typeof Uint8Array.fromBase64 === 'function';
|
|
7
7
|
textEncoder = new TextEncoder();
|
|
8
8
|
textDecoder = new TextDecoder();
|
package/services/cryptos.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Converter } from './converter.mjs';
|
|
2
|
-
const IS_BROWSER = typeof
|
|
2
|
+
const IS_BROWSER = typeof self !== 'undefined';
|
|
3
3
|
|
|
4
4
|
// ED25519 EXPOSURE NODEJS/BROWSER COMPATIBLE ---------------------------------
|
|
5
5
|
const { ed25519, x25519 } = await import('@noble/curves/ed25519.js');
|