@hive-p2p/browser 1.0.34 → 1.0.35

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 CHANGED
@@ -3,18 +3,27 @@ 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 mergeHiveConfig(target, source) {
7
+ for (const key in source)
8
+ if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
9
+ target[key] = target[key] || {};
10
+ mergeHiveConfig(target[key], source[key]);
11
+ } else target[key] = source[key];
12
+ }
13
+
6
14
  /**
7
15
  * @typedef {Object} HiveP2PNamespace
8
- * @property {Clock} CLOCK
16
+ * @property {typeof CLOCK} CLOCK
9
17
  * @property {typeof CONFIG} CONFIG
18
+ * @property {typeof mergeHiveConfig} mergeHiveConfig
10
19
  * @property {typeof Node} Node
11
20
  * @property {typeof createNode} createNode
12
21
  * @property {typeof CryptoCodex} CryptoCodex
13
22
  */
14
23
 
15
24
  /** @type {HiveP2PNamespace} */
16
- const HiveP2P = { CLOCK, CONFIG, Node, createNode, CryptoCodex };
17
- export { CLOCK, CONFIG, Node, createNode, CryptoCodex };
25
+ const HiveP2P = { CLOCK, CONFIG, mergeHiveConfig, Node, createNode, CryptoCodex };
26
+ export { CLOCK, CONFIG, mergeHiveConfig, Node, createNode, CryptoCodex };
18
27
  export default HiveP2P;
19
28
 
20
29
  if (typeof window !== 'undefined') window.HiveP2P = HiveP2P;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hive-p2p/browser",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },