@libp2p/daemon-protocol 2.0.2 → 3.0.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.
@@ -20,7 +20,7 @@ export declare class StreamHandler {
20
20
  /**
21
21
  * Return the handshake rest stream and invalidate handler
22
22
  */
23
- rest(): Duplex<Uint8Array, Uint8Array, Promise<void>>;
23
+ rest(): Duplex<Uint8ArrayList, Uint8Array, Promise<void>>;
24
24
  /**
25
25
  * Close the stream
26
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"stream-handler.d.ts","sourceRoot":"","sources":["../../src/stream-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAW;IAC1B,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACtC;;OAEG;gBACU,IAAI,EAAE,oBAAoB;IAQvC;;OAEG;IACG,IAAI;IAYV,KAAK,CAAE,GAAG,EAAE,UAAU,GAAG,cAAc;IAOvC;;OAEG;IACH,IAAI;IAKJ;;OAEG;IACG,KAAK;CAIZ"}
1
+ {"version":3,"file":"stream-handler.d.ts","sourceRoot":"","sources":["../../src/stream-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuB;IACtC,OAAO,EAAE,MAAM,CAAC,cAAc,CAAC,CAAA;IACtC;;OAEG;gBACU,IAAI,EAAE,oBAAoB;IAQvC;;OAEG;IACG,IAAI;IAYV,KAAK,CAAE,GAAG,EAAE,UAAU,GAAG,cAAc;IAOvC;;OAEG;IACH,IAAI;IAKJ;;OAEG;IACG,KAAK;CAIZ"}
@@ -19,7 +19,7 @@ export class StreamHandler {
19
19
  // @ts-expect-error decoder is really a generator
20
20
  const msg = await this.decoder.next();
21
21
  if (msg.value != null) {
22
- return msg.value.slice();
22
+ return msg.value.subarray();
23
23
  }
24
24
  log('read received no value, closing stream');
25
25
  // End the stream, we didn't get data
@@ -1 +1 @@
1
- {"version":3,"file":"stream-handler.js","sourceRoot":"","sources":["../../src/stream-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAKvC,MAAM,GAAG,GAAG,MAAM,CAAC,uCAAuC,CAAC,CAAA;AAO3D,MAAM,OAAO,aAAa;IAIxB;;OAEG;IACH,YAAa,IAA0B;QACrC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,CAAA;QAElC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnC,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,SAAS,I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0.0",
4
4
  "description": "Communication protocol between libp2p daemons and clients",
5
5
  "author": "",
6
6
  "license": "Apache-2.0 OR MIT",
@@ -14,7 +14,7 @@ export interface StreamHandlerOptions {
14
14
 
15
15
  export class StreamHandler {
16
16
  private readonly stream: Duplex<Uint8Array>
17
- private readonly shake: Handshake
17
+ private readonly shake: Handshake<Uint8Array>
18
18
  public decoder: Source<Uint8ArrayList>
19
19
  /**
20
20
  * Create a stream handler for connection
@@ -34,7 +34,7 @@ export class StreamHandler {
34
34
  // @ts-expect-error decoder is really a generator
35
35
  const msg = await this.decoder.next()
36
36
  if (msg.value != null) {
37
- return msg.value.slice()
37
+ return msg.value.subarray()
38
38
  }
39
39
 
40
40
  log('read received no value, closing stream')