@libp2p/mplex 1.2.0 → 1.2.1

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/mplex.js CHANGED
@@ -90,7 +90,7 @@ export class MplexStreamMuxer {
90
90
  _newStream(options) {
91
91
  const maxStreams = this._init.maxStreamsPerConnection ?? MAX_STREAMS_PER_CONNECTION;
92
92
  if ((this._streams.initiators.size + this._streams.receivers.size) === maxStreams) {
93
- throw errCode(new Error('To many streams open'), 'ERR_TOO_MANY_STREAMS');
93
+ throw errCode(new Error('Too many streams open'), 'ERR_TOO_MANY_STREAMS');
94
94
  }
95
95
  const { id, name, type, registry } = options;
96
96
  log('new %s stream %s %s', type, id, name);
@@ -1 +1 @@
1
- {"version":3,"file":"mplex.js","sourceRoot":"","sources":["../../src/mplex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAY,SAAS,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAW,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,OAAO,MAAM,UAAU,CAAA;AAO9B,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;AAElC,MAAM,0BAA0B,GAAG,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AM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;oBAEnB,OAAM;iBACP;gBAED,6DAA6D;gBAC7D,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;gBACxC,MAAK;YACP,KAAK,YAAY,CAAC,eAAe,CAAC;YAClC,KAAK,YAAY,CAAC,cAAc;gBAC9B,8DAA8D;gBAC9D,MAAM,CAAC,SAAS,EAAE,CAAA;gBAClB,MAAK;YACP,KAAK,YAAY,CAAC,eAAe,CAAC;YAClC,KAAK,YAAY,CAAC,cAAc;gBAC9B,qDAAqD;gBACrD,MAAM,CAAC,KAAK,EAAE,CAAA;gBACd,MAAK;YACP;gBACE,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAA;SACvC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/mplex",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "JavaScript implementation of https://github.com/libp2p/mplex",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p-mplex#readme",
package/src/mplex.ts CHANGED
@@ -127,7 +127,7 @@ export class MplexStreamMuxer implements StreamMuxer {
127
127
  const maxStreams = this._init.maxStreamsPerConnection ?? MAX_STREAMS_PER_CONNECTION
128
128
 
129
129
  if ((this._streams.initiators.size + this._streams.receivers.size) === maxStreams) {
130
- throw errCode(new Error('To many streams open'), 'ERR_TOO_MANY_STREAMS')
130
+ throw errCode(new Error('Too many streams open'), 'ERR_TOO_MANY_STREAMS')
131
131
  }
132
132
 
133
133
  const { id, name, type, registry } = options