@peerbit/stream 5.0.16 → 5.1.0
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/dist/src/index.d.ts +76 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +394 -84
- package/dist/src/index.js.map +1 -1
- package/dist/src/routes.d.ts +31 -3
- package/dist/src/routes.d.ts.map +1 -1
- package/dist/src/routes.js.map +1 -1
- package/dist/src/rust-core.d.ts +561 -0
- package/dist/src/rust-core.d.ts.map +1 -0
- package/dist/src/rust-core.js +16 -0
- package/dist/src/rust-core.js.map +1 -0
- package/package.json +6 -6
- package/src/index.ts +545 -98
- package/src/routes.ts +43 -2
- package/src/rust-core.ts +696 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only injection point: when the `PEERBIT_STREAM_RUST_CORE` env flag is
|
|
3
|
+
* set, DirectStream instances constructed without an explicit `rustCore`
|
|
4
|
+
* option pick up the core installed on globalThis under this key. This lets
|
|
5
|
+
* the full @peerbit/stream test-suite run unmodified against the native core
|
|
6
|
+
* (`rustCore: false` opts a specific instance out).
|
|
7
|
+
*/
|
|
8
|
+
export const RUST_CORE_GLOBAL_KEY = "__peerbitStreamRustCore";
|
|
9
|
+
export const resolveInjectedRustCore = () => {
|
|
10
|
+
const processLike = globalThis.process;
|
|
11
|
+
if (!processLike?.env?.PEERBIT_STREAM_RUST_CORE) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return globalThis[RUST_CORE_GLOBAL_KEY];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=rust-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rust-core.js","sourceRoot":"","sources":["../../src/rust-core.ts"],"names":[],"mappings":"AAkqBA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAA+B,EAAE;IACvE,MAAM,WAAW,GAChB,UAGA,CAAC,OAAO,CAAC;IACV,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,wBAAwB,EAAE,CAAC;QACjD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAQ,UAAsC,CAAC,oBAAoB,CAEvD,CAAC;AACd,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerbit/stream",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "A building block for direct streaming protocols",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@types/fast-fifo": "^1.0.2",
|
|
75
75
|
"@types/sinon": "^10.0.20",
|
|
76
76
|
"sinon": "^21.0.0",
|
|
77
|
-
"@peerbit/libp2p-test-utils": "3.0.
|
|
77
|
+
"@peerbit/libp2p-test-utils": "3.0.6"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
@@ -99,11 +99,11 @@
|
|
|
99
99
|
"uint8arraylist": "^2.4.8",
|
|
100
100
|
"uint8arrays": "^5.1.0",
|
|
101
101
|
"yallist": "^5.0.0",
|
|
102
|
-
"@peerbit/cache": "3.
|
|
102
|
+
"@peerbit/cache": "3.1.0",
|
|
103
103
|
"@peerbit/logger": "2.0.1",
|
|
104
|
-
"@peerbit/
|
|
105
|
-
"@peerbit/
|
|
106
|
-
"@peerbit/
|
|
104
|
+
"@peerbit/stream-interface": "6.0.11",
|
|
105
|
+
"@peerbit/time": "3.0.0",
|
|
106
|
+
"@peerbit/crypto": "3.1.2"
|
|
107
107
|
},
|
|
108
108
|
"scripts": {
|
|
109
109
|
"bench": "TS_NODE_PROJECT=../../../tsconfig.json node --loader ts-node/esm ./benchmark/index.ts",
|