@s21g/peerjs 1.5.4-18 → 1.5.4-20
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/bundler.cjs +92 -40
- package/dist/bundler.cjs.map +1 -1
- package/dist/bundler.mjs +92 -40
- package/dist/bundler.mjs.map +1 -1
- package/dist/peerjs.js +48 -27
- package/dist/peerjs.js.map +1 -1
- package/dist/peerjs.min.js +2 -2
- package/dist/peerjs.min.js.map +1 -1
- package/dist/serializer.msgpack.mjs +1 -1
- package/dist/serializer.msgpack.mjs.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/bundler.cjs
CHANGED
|
@@ -154,37 +154,58 @@ const $07e4f6a369d1179a$export$25be9502477c137d = new class {
|
|
|
154
154
|
}();
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const
|
|
157
|
+
const $19f5ce13ac90d2b8$var$getStore = ()=>{
|
|
158
|
+
const g = globalThis;
|
|
159
|
+
const key = "__peerjs_rtc_peer_connection_stats_store__";
|
|
160
|
+
const store = g[key];
|
|
161
|
+
if (store) return store;
|
|
162
|
+
const newStore = {
|
|
163
|
+
active: 0,
|
|
164
|
+
maxActive: 0,
|
|
165
|
+
created: 0,
|
|
166
|
+
closed: 0,
|
|
167
|
+
tracked: new WeakSet(),
|
|
168
|
+
untracked: new WeakSet()
|
|
169
|
+
};
|
|
170
|
+
g[key] = newStore;
|
|
171
|
+
return newStore;
|
|
172
|
+
};
|
|
163
173
|
const $19f5ce13ac90d2b8$export$1c7f507bb1de34ed = (pc)=>{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
174
|
+
const store = $19f5ce13ac90d2b8$var$getStore();
|
|
175
|
+
const tracked = store.tracked;
|
|
176
|
+
if (tracked.has(pc)) return;
|
|
177
|
+
tracked.add(pc);
|
|
178
|
+
store.active++;
|
|
179
|
+
store.created++;
|
|
180
|
+
store.maxActive = Math.max(store.maxActive, store.active);
|
|
169
181
|
};
|
|
170
182
|
const $19f5ce13ac90d2b8$export$54087db615a4d59c = (pc)=>{
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
const store = $19f5ce13ac90d2b8$var$getStore();
|
|
184
|
+
const tracked = store.tracked;
|
|
185
|
+
const untracked = store.untracked;
|
|
186
|
+
if (!tracked.has(pc)) return;
|
|
187
|
+
if (untracked.has(pc)) return;
|
|
188
|
+
untracked.add(pc);
|
|
189
|
+
store.active = Math.max(0, store.active - 1);
|
|
190
|
+
store.closed++;
|
|
191
|
+
};
|
|
192
|
+
const $19f5ce13ac90d2b8$export$1d3a6fe3d6a85616 = ()=>{
|
|
193
|
+
const store = $19f5ce13ac90d2b8$var$getStore();
|
|
194
|
+
return {
|
|
195
|
+
active: store.active,
|
|
196
|
+
maxActive: store.maxActive,
|
|
197
|
+
created: store.created,
|
|
198
|
+
closed: store.closed
|
|
199
|
+
};
|
|
176
200
|
};
|
|
177
|
-
const $19f5ce13ac90d2b8$export$1d3a6fe3d6a85616 = ()=>({
|
|
178
|
-
active: $19f5ce13ac90d2b8$var$active,
|
|
179
|
-
maxActive: $19f5ce13ac90d2b8$var$maxActive,
|
|
180
|
-
created: $19f5ce13ac90d2b8$var$created,
|
|
181
|
-
closed: $19f5ce13ac90d2b8$var$closed
|
|
182
|
-
});
|
|
183
201
|
const $19f5ce13ac90d2b8$export$7feb54d388628e97 = ()=>{
|
|
184
|
-
$19f5ce13ac90d2b8$var$
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
202
|
+
const store = $19f5ce13ac90d2b8$var$getStore();
|
|
203
|
+
store.active = 0;
|
|
204
|
+
store.maxActive = 0;
|
|
205
|
+
store.created = 0;
|
|
206
|
+
store.closed = 0;
|
|
207
|
+
store.tracked = new WeakSet();
|
|
208
|
+
store.untracked = new WeakSet();
|
|
188
209
|
};
|
|
189
210
|
|
|
190
211
|
|
|
@@ -450,7 +471,7 @@ var $1a7e7edd560505fc$export$adb4a1754da6f10d;
|
|
|
450
471
|
|
|
451
472
|
|
|
452
473
|
var $9ce0019dcc6afe7d$exports = {};
|
|
453
|
-
$9ce0019dcc6afe7d$exports = JSON.parse('{"name":"@s21g/peerjs","version":"1.5.4-
|
|
474
|
+
$9ce0019dcc6afe7d$exports = JSON.parse('{"name":"@s21g/peerjs","version":"1.5.4-20","keywords":["peerjs","webrtc","p2p","rtc"],"description":"PeerJS client","homepage":"https://peerjs.com","bugs":{"url":"https://github.com/peers/peerjs/issues"},"repository":{"type":"git","url":"https://github.com/genki/peerjs"},"license":"MIT","contributors":["Michelle Bu <michelle@michellebu.com>","afrokick <devbyru@gmail.com>","ericz <really.ez@gmail.com>","Jairo <kidandcat@gmail.com>","Jonas Gloning <34194370+jonasgloning@users.noreply.github.com>","Jairo Caro-Accino Viciana <jairo@galax.be>","Carlos Caballero <carlos.caballero.gonzalez@gmail.com>","hc <hheennrryy@gmail.com>","Muhammad Asif <capripio@gmail.com>","PrashoonB <prashoonbhattacharjee@gmail.com>","Harsh Bardhan Mishra <47351025+HarshCasper@users.noreply.github.com>","akotynski <aleksanderkotbury@gmail.com>","lmb <i@lmb.io>","Jairooo <jairocaro@msn.com>","Moritz St\xfcckler <moritz.stueckler@gmail.com>","Simon <crydotsnakegithub@gmail.com>","Denis Lukov <denismassters@gmail.com>","Philipp Hancke <fippo@andyet.net>","Hans Oksendahl <hansoksendahl@gmail.com>","Jess <jessachandler@gmail.com>","khankuan <khankuan@gmail.com>","DUODVK <kurmanov.work@gmail.com>","XiZhao <kwang1imsa@gmail.com>","Matthias Lohr <matthias@lohr.me>","=frank tree <=frnktrb@googlemail.com>","Andre Eckardt <aeckardt@outlook.com>","Chris Cowan <agentme49@gmail.com>","Alex Chuev <alex@chuev.com>","alxnull <alxnull@e.mail.de>","Yemel Jardi <angel.jardi@gmail.com>","Ben Parnell <benjaminparnell.94@gmail.com>","Benny Lichtner <bennlich@gmail.com>","fresheneesz <bitetrudpublic@gmail.com>","bob.barstead@exaptive.com <bob.barstead@exaptive.com>","chandika <chandika@gmail.com>","emersion <contact@emersion.fr>","Christopher Van <cvan@users.noreply.github.com>","eddieherm <edhermoso@gmail.com>","Eduardo Pinho <enet4mikeenet@gmail.com>","Evandro Zanatta <ezanatta@tray.net.br>","Gardner Bickford <gardner@users.noreply.github.com>","Gian Luca <gianluca.cecchi@cynny.com>","PatrickJS <github@gdi2290.com>","jonnyf <github@jonathanfoss.co.uk>","Hizkia Felix <hizkifw@gmail.com>","Hristo Oskov <hristo.oskov@gmail.com>","Isaac Madwed <i.madwed@gmail.com>","Ilya Konanykhin <ilya.konanykhin@gmail.com>","jasonbarry <jasbarry@me.com>","Jonathan Burke <jonathan.burke.1311@googlemail.com>","Josh Hamit <josh.hamit@gmail.com>","Jordan Austin <jrax86@gmail.com>","Joel Wetzell <jwetzell@yahoo.com>","xizhao <kevin.wang@cloudera.com>","Alberto Torres <kungfoobar@gmail.com>","Jonathan Mayol <mayoljonathan@gmail.com>","Jefferson Felix <me@jsfelix.dev>","Rolf Erik Lekang <me@rolflekang.com>","Kevin Mai-Husan Chia <mhchia@users.noreply.github.com>","Pepijn de Vos <pepijndevos@gmail.com>","JooYoung <qkdlql@naver.com>","Tobias Speicher <rootcommander@gmail.com>","Steve Blaurock <sblaurock@gmail.com>","Kyrylo Shegeda <shegeda@ualberta.ca>","Diwank Singh Tomer <singh@diwank.name>","So\u0308ren Balko <Soeren.Balko@gmail.com>","Arpit Solanki <solankiarpit1997@gmail.com>","Yuki Ito <yuki@gnnk.net>","Artur Zayats <zag2art@gmail.com>"],"funding":{"type":"opencollective","url":"https://opencollective.com/peer"},"collective":{"type":"opencollective","url":"https://opencollective.com/peer"},"files":["dist/*"],"sideEffects":["lib/global.ts","lib/supports.ts"],"main":"dist/bundler.cjs","module":"dist/bundler.mjs","browser-minified":"dist/peerjs.min.js","browser-unminified":"dist/peerjs.js","browser-minified-msgpack":"dist/serializer.msgpack.mjs","types":"dist/types.d.ts","engines":{"node":">= 14"},"targets":{"types":{"source":"lib/exports.ts"},"main":{"source":"lib/exports.ts","sourceMap":{"inlineSources":true}},"module":{"source":"lib/exports.ts","includeNodeModules":["eventemitter3"],"sourceMap":{"inlineSources":true}},"browser-minified":{"context":"browser","outputFormat":"global","optimize":true,"engines":{"browsers":"chrome >= 83, edge >= 83, firefox >= 80, safari >= 15"},"source":"lib/global.ts"},"browser-unminified":{"context":"browser","outputFormat":"global","optimize":false,"engines":{"browsers":"chrome >= 83, edge >= 83, firefox >= 80, safari >= 15"},"source":"lib/global.ts"},"browser-minified-msgpack":{"context":"browser","outputFormat":"esmodule","isLibrary":true,"optimize":true,"engines":{"browsers":"chrome >= 83, edge >= 83, firefox >= 102, safari >= 15"},"source":"lib/dataconnection/StreamConnection/MsgPack.ts"}},"scripts":{"contributors":"git-authors-cli --print=false && prettier --write package.json && git add package.json package-lock.json && git commit -m \\"chore(contributors): update and sort contributors list\\"","check":"tsc --noEmit && tsc -p e2e/tsconfig.json --noEmit","watch":"parcel watch","build":"rm -rf dist && parcel build","build:jotter":"npm run build && node tools/jotter/patch-dist.mjs","prepublishOnly":"npm run build:jotter","test":"jest","test:watch":"jest --watch","coverage":"jest --coverage --collectCoverageFrom=\\"./lib/**\\"","format":"prettier --write .","format:check":"prettier --check .","semantic-release":"semantic-release","e2e":"wdio run e2e/wdio.local.conf.ts","e2e:bstack":"wdio run e2e/wdio.bstack.conf.ts"},"devDependencies":{"@parcel/config-default":"^2.9.3","@parcel/packager-ts":"^2.9.3","@parcel/transformer-typescript-tsc":"^2.9.3","@parcel/transformer-typescript-types":"^2.9.3","@semantic-release/changelog":"^6.0.1","@semantic-release/git":"^10.0.1","@swc/core":"^1.3.27","@swc/jest":"^0.2.24","@types/jasmine":"^4.3.4","@wdio/browserstack-service":"^8.11.2","@wdio/cli":"^8.11.2","@wdio/globals":"^8.11.2","@wdio/jasmine-framework":"^8.11.2","@wdio/local-runner":"^8.11.2","@wdio/spec-reporter":"^8.11.2","@wdio/types":"^8.10.4","http-server":"^14.1.1","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","mock-socket":"^9.0.0","parcel":"^2.9.3","prettier":"^3.0.0","semantic-release":"^21.0.0","ts-node":"^10.9.1","typescript":"^5.0.0","wdio-geckodriver-service":"^5.0.1"},"dependencies":{"@msgpack/msgpack":"^2.8.0","eventemitter3":"^4.0.7","peerjs-js-binarypack":"^2.1.0","webrtc-adapter":"^9.0.0"},"alias":{"process":false,"buffer":false}}');
|
|
454
475
|
|
|
455
476
|
|
|
456
477
|
class $e5e868bf3ea73e5b$export$4798917dbf149b79 extends (0, $2QID2$eventemitter3.EventEmitter) {
|
|
@@ -1666,6 +1687,15 @@ class $2ddecb16305b5a82$export$ecd1fc136c422448 extends (0, $cf62563e7a9fbce5$ex
|
|
|
1666
1687
|
|
|
1667
1688
|
|
|
1668
1689
|
class $544799118fa637e6$export$72aa44612e2200cd extends (0, $f188f8cb0f63b180$export$d365f7ad9d7df9c9) {
|
|
1690
|
+
static #_ = this.NOOP_WRITER = {
|
|
1691
|
+
write: async ()=>undefined,
|
|
1692
|
+
close: async ()=>undefined,
|
|
1693
|
+
abort: async ()=>undefined,
|
|
1694
|
+
releaseLock: ()=>undefined,
|
|
1695
|
+
desiredSize: null,
|
|
1696
|
+
ready: Promise.resolve(),
|
|
1697
|
+
closed: Promise.resolve()
|
|
1698
|
+
};
|
|
1669
1699
|
constructor(peerId, provider, options){
|
|
1670
1700
|
super(peerId, provider, {
|
|
1671
1701
|
...options,
|
|
@@ -1675,6 +1705,7 @@ class $544799118fa637e6$export$72aa44612e2200cd extends (0, $f188f8cb0f63b180$ex
|
|
|
1675
1705
|
this._bufferedAmountLowWait = null;
|
|
1676
1706
|
this._rawReadController = null;
|
|
1677
1707
|
this._rawReadOnOpen = null;
|
|
1708
|
+
this._sendPipeAbortController = new AbortController();
|
|
1678
1709
|
this._splitStream = new TransformStream({
|
|
1679
1710
|
transform: (chunk, controller)=>{
|
|
1680
1711
|
for(let split = 0; split < chunk.length; split += this._CHUNK_SIZE)controller.enqueue(chunk.subarray(split, split + this._CHUNK_SIZE));
|
|
@@ -1730,7 +1761,9 @@ class $544799118fa637e6$export$72aa44612e2200cd extends (0, $f188f8cb0f63b180$ex
|
|
|
1730
1761
|
this._rawReadController = null;
|
|
1731
1762
|
}
|
|
1732
1763
|
});
|
|
1733
|
-
this._splitStream.readable.pipeTo(this._rawSendStream
|
|
1764
|
+
this._splitStream.readable.pipeTo(this._rawSendStream, {
|
|
1765
|
+
signal: this._sendPipeAbortController.signal
|
|
1766
|
+
}).catch(()=>{});
|
|
1734
1767
|
}
|
|
1735
1768
|
_waitForBufferedAmountLow() {
|
|
1736
1769
|
if (this._bufferedAmountLowWait) return this._bufferedAmountLowWait;
|
|
@@ -1738,24 +1771,27 @@ class $544799118fa637e6$export$72aa44612e2200cd extends (0, $f188f8cb0f63b180$ex
|
|
|
1738
1771
|
if (!dc) return Promise.resolve();
|
|
1739
1772
|
this._bufferedAmountLowWait = new Promise((resolve)=>{
|
|
1740
1773
|
let done = false;
|
|
1774
|
+
const cleanup = ()=>{
|
|
1775
|
+
this.off("close", onClose);
|
|
1776
|
+
try {
|
|
1777
|
+
dc.removeEventListener("bufferedamountlow", onLow);
|
|
1778
|
+
} catch {
|
|
1779
|
+
// 無視する。
|
|
1780
|
+
}
|
|
1781
|
+
};
|
|
1741
1782
|
const finish = ()=>{
|
|
1742
1783
|
if (done) return;
|
|
1743
1784
|
done = true;
|
|
1744
1785
|
this._bufferedAmountLowWait = null;
|
|
1786
|
+
cleanup();
|
|
1745
1787
|
resolve();
|
|
1746
1788
|
};
|
|
1747
1789
|
const onLow = ()=>finish();
|
|
1790
|
+
const onClose = ()=>finish();
|
|
1748
1791
|
dc.addEventListener("bufferedamountlow", onLow, {
|
|
1749
1792
|
once: true
|
|
1750
1793
|
});
|
|
1751
|
-
this.once("close",
|
|
1752
|
-
try {
|
|
1753
|
-
dc.removeEventListener("bufferedamountlow", onLow);
|
|
1754
|
-
} catch {
|
|
1755
|
-
// 無視する。
|
|
1756
|
-
}
|
|
1757
|
-
finish();
|
|
1758
|
-
});
|
|
1794
|
+
this.once("close", onClose);
|
|
1759
1795
|
});
|
|
1760
1796
|
return this._bufferedAmountLowWait;
|
|
1761
1797
|
}
|
|
@@ -1775,10 +1811,20 @@ class $544799118fa637e6$export$72aa44612e2200cd extends (0, $f188f8cb0f63b180$ex
|
|
|
1775
1811
|
this._rawReadOnOpen = null;
|
|
1776
1812
|
}
|
|
1777
1813
|
const c = this._rawReadController;
|
|
1778
|
-
if (
|
|
1779
|
-
|
|
1814
|
+
if (c) {
|
|
1815
|
+
this._rawReadController = null;
|
|
1816
|
+
try {
|
|
1817
|
+
c.close();
|
|
1818
|
+
} catch {
|
|
1819
|
+
// 無視する。
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
if (!this._sendPipeAbortController.signal.aborted) this._sendPipeAbortController.abort();
|
|
1823
|
+
const writer = this.writer;
|
|
1824
|
+
this.writer = $544799118fa637e6$export$72aa44612e2200cd.NOOP_WRITER;
|
|
1825
|
+
writer.abort().catch(()=>{});
|
|
1780
1826
|
try {
|
|
1781
|
-
|
|
1827
|
+
writer.releaseLock();
|
|
1782
1828
|
} catch {
|
|
1783
1829
|
// 無視する。
|
|
1784
1830
|
}
|
|
@@ -1803,7 +1849,13 @@ class $7e477efb76e02214$export$80f5de1a66c4d624 extends (0, $544799118fa637e6$ex
|
|
|
1803
1849
|
})();
|
|
1804
1850
|
}
|
|
1805
1851
|
_send(data) {
|
|
1806
|
-
|
|
1852
|
+
const encoder = this._encoder;
|
|
1853
|
+
if (!encoder) return Promise.resolve();
|
|
1854
|
+
return this.writer.write(encoder.encode(data));
|
|
1855
|
+
}
|
|
1856
|
+
close(options) {
|
|
1857
|
+
super.close(options);
|
|
1858
|
+
if (!options?.flush) this._encoder = null;
|
|
1807
1859
|
}
|
|
1808
1860
|
}
|
|
1809
1861
|
|