@stripchatdev/ext-helper 0.1.8 → 0.1.10
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/ext-helper.js +8 -10
- package/package.json +1 -1
package/dist/ext-helper.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const S = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol === "iframe_pubsub" && "version" in e && e.version === "1.0",
|
|
1
|
+
const S = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol === "iframe_pubsub" && "version" in e && e.version === "1.0", b = (e, t) => e, w = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
2
2
|
var l;
|
|
3
3
|
(function(e) {
|
|
4
4
|
e.Base32IncorrectEncoding = "B32_ENC_INVALID", e.DecodeTimeInvalidCharacter = "DEC_TIME_CHAR", e.DecodeTimeValueMalformed = "DEC_TIME_MALFORMED", e.EncodeTimeNegative = "ENC_TIME_NEG", e.EncodeTimeSizeExceeded = "ENC_TIME_SIZE_EXCEED", e.EncodeTimeValueMalformed = "ENC_TIME_MALFORMED", e.PRNGDetectFailure = "PRNG_DETECT", e.ULIDInvalid = "ULID_INVALID", e.Unexpected = "UNEXPECTED", e.UUIDInvalid = "UUID_INVALID";
|
|
@@ -49,7 +49,7 @@ function H(e, t = 10) {
|
|
|
49
49
|
function q() {
|
|
50
50
|
return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function E(e, t) {
|
|
53
53
|
const r = _(), n = Date.now();
|
|
54
54
|
return H(n, 10) + P(16, r);
|
|
55
55
|
}
|
|
@@ -63,8 +63,8 @@ const L = ({ seq: e, uniqId: t }) => (r) => ({
|
|
|
63
63
|
},
|
|
64
64
|
...r
|
|
65
65
|
}), y = L({
|
|
66
|
-
uniqId: () =>
|
|
67
|
-
seq: () =>
|
|
66
|
+
uniqId: () => E(),
|
|
67
|
+
seq: () => E()
|
|
68
68
|
});
|
|
69
69
|
class A {
|
|
70
70
|
constructor(t) {
|
|
@@ -90,7 +90,7 @@ class A {
|
|
|
90
90
|
this.brokerId = r, this.transport = n, this.transport.onMessage(this.globalMessageHandler);
|
|
91
91
|
}
|
|
92
92
|
subscribe(t, r) {
|
|
93
|
-
const n =
|
|
93
|
+
const n = b(t);
|
|
94
94
|
let s = this.eventHandlerMap.get(n);
|
|
95
95
|
s || (s = /* @__PURE__ */ new Set(), this.eventHandlerMap.set(n, s)), s.add(r);
|
|
96
96
|
const o = y({
|
|
@@ -100,7 +100,7 @@ class A {
|
|
|
100
100
|
this.transport.send(this.brokerId, o);
|
|
101
101
|
}
|
|
102
102
|
unsubscribe(t, r) {
|
|
103
|
-
const n =
|
|
103
|
+
const n = b(t);
|
|
104
104
|
let s = this.eventHandlerMap.get(n);
|
|
105
105
|
if (!s)
|
|
106
106
|
return;
|
|
@@ -161,7 +161,7 @@ const F = (e) => !!e && typeof e == "object" && "protocol" in e && e.protocol ==
|
|
|
161
161
|
},
|
|
162
162
|
...t
|
|
163
163
|
}), z = B({
|
|
164
|
-
uniqId: () =>
|
|
164
|
+
uniqId: () => E()
|
|
165
165
|
});
|
|
166
166
|
class X {
|
|
167
167
|
constructor(t) {
|
|
@@ -222,10 +222,8 @@ class W {
|
|
|
222
222
|
this.peers = /* @__PURE__ */ new Map(), this.onMessage = (n) => {
|
|
223
223
|
const s = (o) => {
|
|
224
224
|
const { data: i, origin: a, source: c } = o;
|
|
225
|
-
if (!c)
|
|
226
|
-
console.error("[PostMessageTransport] onMessage: source could not be empty");
|
|
225
|
+
if (!c)
|
|
227
226
|
return;
|
|
228
|
-
}
|
|
229
227
|
const h = this.findPeer(c, a);
|
|
230
228
|
if (h)
|
|
231
229
|
try {
|