starpc 0.21.1 → 0.21.2

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/srpc/conn.js CHANGED
@@ -25,7 +25,7 @@ export class Conn {
25
25
  if (server) {
26
26
  this.server = server;
27
27
  }
28
- let muxerFactory = connParams?.muxerFactory ?? yamux()();
28
+ const muxerFactory = connParams?.muxerFactory ?? yamux()();
29
29
  this.muxer = muxerFactory.createStreamMuxer({
30
30
  onIncomingStream: this.handleIncomingStream.bind(this),
31
31
  direction: connParams?.direction || 'outbound',
@@ -1,4 +1,4 @@
1
1
  import { Pushable } from 'it-pushable';
2
2
  import { Source, Sink } from 'it-stream-types';
3
3
  export declare function writeToPushable<T>(dataSource: AsyncIterable<T>, out: Pushable<T>): Promise<void>;
4
- export declare function buildPushableSink<T extends Iterable<any> | AsyncIterable<any>>(target: Pushable<T>): Sink<Source<T>, Promise<void>>;
4
+ export declare function buildPushableSink<T>(target: Pushable<T>): Sink<Source<T>, Promise<void>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
package/srpc/conn.ts CHANGED
@@ -78,7 +78,7 @@ export class Conn
78
78
  if (server) {
79
79
  this.server = server
80
80
  }
81
- let muxerFactory = connParams?.muxerFactory ?? yamux()()
81
+ const muxerFactory = connParams?.muxerFactory ?? yamux()()
82
82
  this.muxer = muxerFactory.createStreamMuxer({
83
83
  onIncomingStream: this.handleIncomingStream.bind(this),
84
84
  direction: connParams?.direction || 'outbound',
@@ -1,4 +1,4 @@
1
- import type { Sink, Source } from 'it-stream-types'
1
+ import type { Source } from 'it-stream-types'
2
2
  import { EventIterator } from 'event-iterator'
3
3
 
4
4
  import { ConnParams } from './conn.js'
package/srpc/pushable.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Pushable } from 'it-pushable'
2
2
  import { Source, Sink } from 'it-stream-types'
3
- import { castToError } from './errors.js'
4
3
 
5
4
  // writeToPushable writes the incoming server data to the pushable.
6
5
  export async function writeToPushable<T>(
@@ -18,11 +17,7 @@ export async function writeToPushable<T>(
18
17
  }
19
18
  }
20
19
 
21
- export function buildPushableSink<T extends Iterable<any> | AsyncIterable<any>>(
22
- target: Pushable<T>,
23
- ): Sink<Source<T>, Promise<void>>
24
-
25
- export function buildPushableSink<T extends Iterable<any> | AsyncIterable<any>>(
20
+ export function buildPushableSink<T>(
26
21
  target: Pushable<T>,
27
22
  ): Sink<Source<T>, Promise<void>> {
28
23
  return async (source: Source<T>): Promise<void> => {