@hive-p2p/server 1.0.35 → 1.0.36
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/index.mjs +5 -5
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -3,11 +3,11 @@ import { CryptoCodex } from "./core/crypto-codex.mjs";
|
|
|
3
3
|
import { CLOCK } from "./services/clock.mjs';
|
|
4
4
|
import CONFIG from "./core/config.mjs";
|
|
5
5
|
|
|
6
|
-
function
|
|
6
|
+
function mergeConfig(target, source) {
|
|
7
7
|
for (const key in source)
|
|
8
8
|
if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
9
9
|
target[key] = target[key] || {};
|
|
10
|
-
|
|
10
|
+
mergeConfig(target[key], source[key]);
|
|
11
11
|
} else target[key] = source[key];
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ function mergeHiveConfig(target, source) {
|
|
|
15
15
|
* @typedef {Object} HiveP2PNamespace
|
|
16
16
|
* @property {typeof CLOCK} CLOCK
|
|
17
17
|
* @property {typeof CONFIG} CONFIG
|
|
18
|
-
* @property {typeof
|
|
18
|
+
* @property {typeof mergeConfig} mergeConfig
|
|
19
19
|
* @property {typeof Node} Node
|
|
20
20
|
* @property {typeof createNode} createNode
|
|
21
21
|
* @property {typeof CryptoCodex} CryptoCodex
|
|
@@ -23,6 +23,6 @@ function mergeHiveConfig(target, source) {
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
/** @type {HiveP2PNamespace} */
|
|
26
|
-
const HiveP2P = { CLOCK, CONFIG,
|
|
27
|
-
export { CLOCK, CONFIG,
|
|
26
|
+
const HiveP2P = { CLOCK, CONFIG, mergeConfig, Node, createNode, createPublicNode, CryptoCodex };
|
|
27
|
+
export { CLOCK, CONFIG, mergeConfig, Node, createNode, createPublicNode, CryptoCodex };
|
|
28
28
|
export default HiveP2P;
|