@everymatrix/nuts-inbox-widget 1.86.26 → 1.86.28
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/hydrate/index.js
CHANGED
|
@@ -2978,7 +2978,7 @@ class Transport extends Emitter {
|
|
|
2978
2978
|
}
|
|
2979
2979
|
_port() {
|
|
2980
2980
|
if (this.opts.port &&
|
|
2981
|
-
((this.opts.secure && Number(this.opts.port !== 443)
|
|
2981
|
+
((this.opts.secure && Number(this.opts.port) !== 443) ||
|
|
2982
2982
|
(!this.opts.secure && Number(this.opts.port) !== 80))) {
|
|
2983
2983
|
return ":" + this.opts.port;
|
|
2984
2984
|
}
|
|
@@ -4599,11 +4599,11 @@ function _reconstructPacket(data, buffers) {
|
|
|
4599
4599
|
* These strings must not be used as event names, as they have a special meaning.
|
|
4600
4600
|
*/
|
|
4601
4601
|
const RESERVED_EVENTS$1 = [
|
|
4602
|
-
"connect",
|
|
4603
|
-
"connect_error",
|
|
4604
|
-
"disconnect",
|
|
4605
|
-
"disconnecting",
|
|
4606
|
-
"newListener",
|
|
4602
|
+
"connect", // used on the client side
|
|
4603
|
+
"connect_error", // used on the client side
|
|
4604
|
+
"disconnect", // used on both sides
|
|
4605
|
+
"disconnecting", // used on the server side
|
|
4606
|
+
"newListener", // used by the Node.js EventEmitter
|
|
4607
4607
|
"removeListener", // used by the Node.js EventEmitter
|
|
4608
4608
|
];
|
|
4609
4609
|
/**
|
|
@@ -4694,10 +4694,6 @@ class Encoder {
|
|
|
4694
4694
|
return buffers; // write all the buffers
|
|
4695
4695
|
}
|
|
4696
4696
|
}
|
|
4697
|
-
// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript
|
|
4698
|
-
function isObject(value) {
|
|
4699
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
4700
|
-
}
|
|
4701
4697
|
/**
|
|
4702
4698
|
* A socket.io Decoder instance
|
|
4703
4699
|
*
|
|
@@ -4903,13 +4899,55 @@ class BinaryReconstructor {
|
|
|
4903
4899
|
this.buffers = [];
|
|
4904
4900
|
}
|
|
4905
4901
|
}
|
|
4902
|
+
function isNamespaceValid(nsp) {
|
|
4903
|
+
return typeof nsp === "string";
|
|
4904
|
+
}
|
|
4905
|
+
// see https://caniuse.com/mdn-javascript_builtins_number_isinteger
|
|
4906
|
+
const isInteger = Number.isInteger ||
|
|
4907
|
+
function (value) {
|
|
4908
|
+
return (typeof value === "number" &&
|
|
4909
|
+
isFinite(value) &&
|
|
4910
|
+
Math.floor(value) === value);
|
|
4911
|
+
};
|
|
4912
|
+
function isAckIdValid(id) {
|
|
4913
|
+
return id === undefined || isInteger(id);
|
|
4914
|
+
}
|
|
4915
|
+
// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript
|
|
4916
|
+
function isObject(value) {
|
|
4917
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
4918
|
+
}
|
|
4919
|
+
function isDataValid(type, payload) {
|
|
4920
|
+
switch (type) {
|
|
4921
|
+
case PacketType.CONNECT:
|
|
4922
|
+
return payload === undefined || isObject(payload);
|
|
4923
|
+
case PacketType.DISCONNECT:
|
|
4924
|
+
return payload === undefined;
|
|
4925
|
+
case PacketType.EVENT:
|
|
4926
|
+
return (Array.isArray(payload) &&
|
|
4927
|
+
(typeof payload[0] === "number" ||
|
|
4928
|
+
(typeof payload[0] === "string" &&
|
|
4929
|
+
RESERVED_EVENTS$1.indexOf(payload[0]) === -1)));
|
|
4930
|
+
case PacketType.ACK:
|
|
4931
|
+
return Array.isArray(payload);
|
|
4932
|
+
case PacketType.CONNECT_ERROR:
|
|
4933
|
+
return typeof payload === "string" || isObject(payload);
|
|
4934
|
+
default:
|
|
4935
|
+
return false;
|
|
4936
|
+
}
|
|
4937
|
+
}
|
|
4938
|
+
function isPacketValid(packet) {
|
|
4939
|
+
return (isNamespaceValid(packet.nsp) &&
|
|
4940
|
+
isAckIdValid(packet.id) &&
|
|
4941
|
+
isDataValid(packet.type, packet.data));
|
|
4942
|
+
}
|
|
4906
4943
|
|
|
4907
4944
|
var parser = /*#__PURE__*/Object.freeze({
|
|
4908
4945
|
__proto__: null,
|
|
4909
4946
|
protocol: protocol,
|
|
4910
4947
|
get PacketType () { return PacketType; },
|
|
4911
4948
|
Encoder: Encoder,
|
|
4912
|
-
Decoder: Decoder
|
|
4949
|
+
Decoder: Decoder,
|
|
4950
|
+
isPacketValid: isPacketValid
|
|
4913
4951
|
});
|
|
4914
4952
|
|
|
4915
4953
|
function on(obj, ev, fn) {
|
package/hydrate/index.mjs
CHANGED
|
@@ -2974,7 +2974,7 @@ class Transport extends Emitter {
|
|
|
2974
2974
|
}
|
|
2975
2975
|
_port() {
|
|
2976
2976
|
if (this.opts.port &&
|
|
2977
|
-
((this.opts.secure && Number(this.opts.port !== 443)
|
|
2977
|
+
((this.opts.secure && Number(this.opts.port) !== 443) ||
|
|
2978
2978
|
(!this.opts.secure && Number(this.opts.port) !== 80))) {
|
|
2979
2979
|
return ":" + this.opts.port;
|
|
2980
2980
|
}
|
|
@@ -4595,11 +4595,11 @@ function _reconstructPacket(data, buffers) {
|
|
|
4595
4595
|
* These strings must not be used as event names, as they have a special meaning.
|
|
4596
4596
|
*/
|
|
4597
4597
|
const RESERVED_EVENTS$1 = [
|
|
4598
|
-
"connect",
|
|
4599
|
-
"connect_error",
|
|
4600
|
-
"disconnect",
|
|
4601
|
-
"disconnecting",
|
|
4602
|
-
"newListener",
|
|
4598
|
+
"connect", // used on the client side
|
|
4599
|
+
"connect_error", // used on the client side
|
|
4600
|
+
"disconnect", // used on both sides
|
|
4601
|
+
"disconnecting", // used on the server side
|
|
4602
|
+
"newListener", // used by the Node.js EventEmitter
|
|
4603
4603
|
"removeListener", // used by the Node.js EventEmitter
|
|
4604
4604
|
];
|
|
4605
4605
|
/**
|
|
@@ -4690,10 +4690,6 @@ class Encoder {
|
|
|
4690
4690
|
return buffers; // write all the buffers
|
|
4691
4691
|
}
|
|
4692
4692
|
}
|
|
4693
|
-
// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript
|
|
4694
|
-
function isObject(value) {
|
|
4695
|
-
return Object.prototype.toString.call(value) === "[object Object]";
|
|
4696
|
-
}
|
|
4697
4693
|
/**
|
|
4698
4694
|
* A socket.io Decoder instance
|
|
4699
4695
|
*
|
|
@@ -4899,13 +4895,55 @@ class BinaryReconstructor {
|
|
|
4899
4895
|
this.buffers = [];
|
|
4900
4896
|
}
|
|
4901
4897
|
}
|
|
4898
|
+
function isNamespaceValid(nsp) {
|
|
4899
|
+
return typeof nsp === "string";
|
|
4900
|
+
}
|
|
4901
|
+
// see https://caniuse.com/mdn-javascript_builtins_number_isinteger
|
|
4902
|
+
const isInteger = Number.isInteger ||
|
|
4903
|
+
function (value) {
|
|
4904
|
+
return (typeof value === "number" &&
|
|
4905
|
+
isFinite(value) &&
|
|
4906
|
+
Math.floor(value) === value);
|
|
4907
|
+
};
|
|
4908
|
+
function isAckIdValid(id) {
|
|
4909
|
+
return id === undefined || isInteger(id);
|
|
4910
|
+
}
|
|
4911
|
+
// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript
|
|
4912
|
+
function isObject(value) {
|
|
4913
|
+
return Object.prototype.toString.call(value) === "[object Object]";
|
|
4914
|
+
}
|
|
4915
|
+
function isDataValid(type, payload) {
|
|
4916
|
+
switch (type) {
|
|
4917
|
+
case PacketType.CONNECT:
|
|
4918
|
+
return payload === undefined || isObject(payload);
|
|
4919
|
+
case PacketType.DISCONNECT:
|
|
4920
|
+
return payload === undefined;
|
|
4921
|
+
case PacketType.EVENT:
|
|
4922
|
+
return (Array.isArray(payload) &&
|
|
4923
|
+
(typeof payload[0] === "number" ||
|
|
4924
|
+
(typeof payload[0] === "string" &&
|
|
4925
|
+
RESERVED_EVENTS$1.indexOf(payload[0]) === -1)));
|
|
4926
|
+
case PacketType.ACK:
|
|
4927
|
+
return Array.isArray(payload);
|
|
4928
|
+
case PacketType.CONNECT_ERROR:
|
|
4929
|
+
return typeof payload === "string" || isObject(payload);
|
|
4930
|
+
default:
|
|
4931
|
+
return false;
|
|
4932
|
+
}
|
|
4933
|
+
}
|
|
4934
|
+
function isPacketValid(packet) {
|
|
4935
|
+
return (isNamespaceValid(packet.nsp) &&
|
|
4936
|
+
isAckIdValid(packet.id) &&
|
|
4937
|
+
isDataValid(packet.type, packet.data));
|
|
4938
|
+
}
|
|
4902
4939
|
|
|
4903
4940
|
var parser = /*#__PURE__*/Object.freeze({
|
|
4904
4941
|
__proto__: null,
|
|
4905
4942
|
protocol: protocol,
|
|
4906
4943
|
get PacketType () { return PacketType; },
|
|
4907
4944
|
Encoder: Encoder,
|
|
4908
|
-
Decoder: Decoder
|
|
4945
|
+
Decoder: Decoder,
|
|
4946
|
+
isPacketValid: isPacketValid
|
|
4909
4947
|
});
|
|
4910
4948
|
|
|
4911
4949
|
function on(obj, ev, fn) {
|