@ntlab/ntjs-assets 1.1.1 → 1.1.3
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/assets/js/jquery/jquery.js +10909 -10881
- package/assets/js/jquery/jquery.min.js +2 -2
- package/assets/js/jquery/jquery.slim.js +8810 -0
- package/assets/js/jquery/jquery.slim.min.js +2 -0
- package/assets/js/jquery/jquery.slim.min.map +1 -0
- package/assets/js/semantic-ui/components/accordion.css +177 -37
- package/assets/js/semantic-ui/components/accordion.js +10 -4
- package/assets/js/semantic-ui/components/accordion.min.css +2 -2
- package/assets/js/semantic-ui/components/accordion.min.js +3 -3
- package/assets/js/semantic-ui/components/ad.css +4 -4
- package/assets/js/semantic-ui/components/ad.min.css +2 -2
- package/assets/js/semantic-ui/components/api.js +93 -34
- package/assets/js/semantic-ui/components/api.min.js +3 -3
- package/assets/js/semantic-ui/components/breadcrumb.css +1 -1
- package/assets/js/semantic-ui/components/breadcrumb.min.css +1 -1
- package/assets/js/semantic-ui/components/button.css +204 -157
- package/assets/js/semantic-ui/components/button.min.css +2 -2
- package/assets/js/semantic-ui/components/calendar.css +18 -1
- package/assets/js/semantic-ui/components/calendar.js +201 -83
- package/assets/js/semantic-ui/components/calendar.min.css +2 -2
- package/assets/js/semantic-ui/components/calendar.min.js +3 -3
- package/assets/js/semantic-ui/components/card.css +754 -117
- package/assets/js/semantic-ui/components/card.min.css +2 -2
- package/assets/js/semantic-ui/components/checkbox.css +93 -92
- package/assets/js/semantic-ui/components/checkbox.js +21 -14
- package/assets/js/semantic-ui/components/checkbox.min.css +2 -2
- package/assets/js/semantic-ui/components/checkbox.min.js +3 -3
- package/assets/js/semantic-ui/components/comment.css +12 -12
- package/assets/js/semantic-ui/components/comment.min.css +2 -2
- package/assets/js/semantic-ui/components/container.css +98 -4
- package/assets/js/semantic-ui/components/container.min.css +2 -2
- package/assets/js/semantic-ui/components/dimmer.css +33 -18
- package/assets/js/semantic-ui/components/dimmer.js +25 -10
- package/assets/js/semantic-ui/components/dimmer.min.css +2 -2
- package/assets/js/semantic-ui/components/dimmer.min.js +3 -3
- package/assets/js/semantic-ui/components/divider.css +31 -31
- package/assets/js/semantic-ui/components/divider.min.css +2 -2
- package/assets/js/semantic-ui/components/dropdown.css +101 -51
- package/assets/js/semantic-ui/components/dropdown.js +250 -205
- package/assets/js/semantic-ui/components/dropdown.min.css +2 -2
- package/assets/js/semantic-ui/components/dropdown.min.js +3 -3
- package/assets/js/semantic-ui/components/embed.css +5 -5
- package/assets/js/semantic-ui/components/embed.js +14 -10
- package/assets/js/semantic-ui/components/embed.min.css +2 -2
- package/assets/js/semantic-ui/components/embed.min.js +3 -3
- package/assets/js/semantic-ui/components/emoji.css +10799 -8841
- package/assets/js/semantic-ui/components/emoji.min.css +1 -1
- package/assets/js/semantic-ui/components/feed.css +29 -29
- package/assets/js/semantic-ui/components/feed.min.css +2 -2
- package/assets/js/semantic-ui/components/flag.css +1021 -915
- package/assets/js/semantic-ui/components/flag.min.css +2 -2
- package/assets/js/semantic-ui/components/flyout.css +592 -0
- package/assets/js/semantic-ui/components/flyout.js +1530 -0
- package/assets/js/semantic-ui/components/flyout.min.css +9 -0
- package/assets/js/semantic-ui/components/flyout.min.js +11 -0
- package/assets/js/semantic-ui/components/form.css +160 -83
- package/assets/js/semantic-ui/components/form.js +48 -42
- package/assets/js/semantic-ui/components/form.min.css +2 -2
- package/assets/js/semantic-ui/components/form.min.js +3 -3
- package/assets/js/semantic-ui/components/grid.css +25 -21
- package/assets/js/semantic-ui/components/grid.min.css +2 -2
- package/assets/js/semantic-ui/components/header.css +6 -4
- package/assets/js/semantic-ui/components/header.min.css +2 -2
- package/assets/js/semantic-ui/components/icon.css +2110 -2061
- package/assets/js/semantic-ui/components/icon.min.css +2 -2
- package/assets/js/semantic-ui/components/image.css +1 -1
- package/assets/js/semantic-ui/components/image.min.css +1 -1
- package/assets/js/semantic-ui/components/input.css +759 -22
- package/assets/js/semantic-ui/components/input.min.css +2 -2
- package/assets/js/semantic-ui/components/item.css +17 -17
- package/assets/js/semantic-ui/components/item.min.css +2 -2
- package/assets/js/semantic-ui/components/label.css +72 -68
- package/assets/js/semantic-ui/components/label.min.css +2 -2
- package/assets/js/semantic-ui/components/list.css +31 -31
- package/assets/js/semantic-ui/components/list.min.css +2 -2
- package/assets/js/semantic-ui/components/loader.css +352 -352
- package/assets/js/semantic-ui/components/loader.min.css +2 -2
- package/assets/js/semantic-ui/components/menu.css +108 -76
- package/assets/js/semantic-ui/components/menu.min.css +1 -1
- package/assets/js/semantic-ui/components/message.css +43 -43
- package/assets/js/semantic-ui/components/message.min.css +2 -2
- package/assets/js/semantic-ui/components/modal.css +37 -6
- package/assets/js/semantic-ui/components/modal.js +188 -84
- package/assets/js/semantic-ui/components/modal.min.css +2 -2
- package/assets/js/semantic-ui/components/modal.min.js +3 -3
- package/assets/js/semantic-ui/components/nag.css +1 -1
- package/assets/js/semantic-ui/components/nag.js +3 -3
- package/assets/js/semantic-ui/components/nag.min.css +1 -1
- package/assets/js/semantic-ui/components/nag.min.js +3 -3
- package/assets/js/semantic-ui/components/placeholder.css +33 -33
- package/assets/js/semantic-ui/components/placeholder.min.css +2 -2
- package/assets/js/semantic-ui/components/popup.css +103 -105
- package/assets/js/semantic-ui/components/popup.js +17 -23
- package/assets/js/semantic-ui/components/popup.min.css +2 -2
- package/assets/js/semantic-ui/components/popup.min.js +3 -3
- package/assets/js/semantic-ui/components/progress.css +1 -1
- package/assets/js/semantic-ui/components/progress.js +6 -3
- package/assets/js/semantic-ui/components/progress.min.css +1 -1
- package/assets/js/semantic-ui/components/progress.min.js +3 -3
- package/assets/js/semantic-ui/components/rail.css +1 -1
- package/assets/js/semantic-ui/components/rail.min.css +1 -1
- package/assets/js/semantic-ui/components/rating.css +7 -46
- package/assets/js/semantic-ui/components/rating.js +8 -4
- package/assets/js/semantic-ui/components/rating.min.css +2 -2
- package/assets/js/semantic-ui/components/rating.min.js +3 -3
- package/assets/js/semantic-ui/components/reset.css +5 -4
- package/assets/js/semantic-ui/components/reset.min.css +2 -2
- package/assets/js/semantic-ui/components/reveal.css +1 -1
- package/assets/js/semantic-ui/components/reveal.min.css +1 -1
- package/assets/js/semantic-ui/components/search.css +6 -6
- package/assets/js/semantic-ui/components/search.js +48 -21
- package/assets/js/semantic-ui/components/search.min.css +2 -2
- package/assets/js/semantic-ui/components/search.min.js +3 -3
- package/assets/js/semantic-ui/components/segment.css +118 -34
- package/assets/js/semantic-ui/components/segment.min.css +2 -2
- package/assets/js/semantic-ui/components/shape.css +1 -1
- package/assets/js/semantic-ui/components/shape.js +4 -4
- package/assets/js/semantic-ui/components/shape.min.css +1 -1
- package/assets/js/semantic-ui/components/shape.min.js +3 -3
- package/assets/js/semantic-ui/components/sidebar.css +23 -9
- package/assets/js/semantic-ui/components/sidebar.js +141 -44
- package/assets/js/semantic-ui/components/sidebar.min.css +2 -2
- package/assets/js/semantic-ui/components/sidebar.min.js +3 -3
- package/assets/js/semantic-ui/components/site.css +139 -42
- package/assets/js/semantic-ui/components/site.js +2 -2
- package/assets/js/semantic-ui/components/site.min.css +2 -2
- package/assets/js/semantic-ui/components/site.min.js +3 -3
- package/assets/js/semantic-ui/components/slider.css +17 -17
- package/assets/js/semantic-ui/components/slider.js +79 -64
- package/assets/js/semantic-ui/components/slider.min.css +1 -1
- package/assets/js/semantic-ui/components/slider.min.js +3 -3
- package/assets/js/semantic-ui/components/state.js +3 -3
- package/assets/js/semantic-ui/components/state.min.js +3 -3
- package/assets/js/semantic-ui/components/statistic.css +4 -4
- package/assets/js/semantic-ui/components/statistic.min.css +2 -2
- package/assets/js/semantic-ui/components/step.css +32 -32
- package/assets/js/semantic-ui/components/step.min.css +2 -2
- package/assets/js/semantic-ui/components/sticky.css +1 -1
- package/assets/js/semantic-ui/components/sticky.js +31 -20
- package/assets/js/semantic-ui/components/sticky.min.css +1 -1
- package/assets/js/semantic-ui/components/sticky.min.js +3 -3
- package/assets/js/semantic-ui/components/tab.css +5 -5
- package/assets/js/semantic-ui/components/tab.js +25 -7
- package/assets/js/semantic-ui/components/tab.min.css +2 -2
- package/assets/js/semantic-ui/components/tab.min.js +3 -3
- package/assets/js/semantic-ui/components/table.css +1684 -272
- package/assets/js/semantic-ui/components/table.min.css +2 -2
- package/assets/js/semantic-ui/components/text.css +1 -1
- package/assets/js/semantic-ui/components/text.min.css +1 -1
- package/assets/js/semantic-ui/components/toast.css +49 -1
- package/assets/js/semantic-ui/components/toast.js +68 -34
- package/assets/js/semantic-ui/components/toast.min.css +2 -2
- package/assets/js/semantic-ui/components/toast.min.js +3 -3
- package/assets/js/semantic-ui/components/transition.css +1 -1
- package/assets/js/semantic-ui/components/transition.js +27 -22
- package/assets/js/semantic-ui/components/transition.min.css +1 -1
- package/assets/js/semantic-ui/components/transition.min.js +3 -3
- package/assets/js/semantic-ui/components/visibility.js +5 -5
- package/assets/js/semantic-ui/components/visibility.min.js +3 -3
- package/assets/js/semantic-ui/semantic.css +41970 -34600
- package/assets/js/semantic-ui/semantic.js +2859 -756
- package/assets/js/semantic-ui/semantic.min.css +3 -3
- package/assets/js/semantic-ui/semantic.min.js +3 -3
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Bold.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-BoldItalic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Italic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/Lato-Regular.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Bold.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-BoldItalic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Italic.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/LatoLatin-Regular.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/brand-icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff +0 -0
- package/assets/js/semantic-ui/themes/default/assets/fonts/outline-icons.woff2 +0 -0
- package/assets/js/semantic-ui/themes/famfamfam/assets/images/flags.png +0 -0
- package/assets/js/socket.io/socket.io.esm.min.js +2 -2
- package/assets/js/socket.io/socket.io.esm.min.js.map +1 -1
- package/assets/js/socket.io/socket.io.js +232 -102
- package/assets/js/socket.io/socket.io.js.map +1 -1
- package/assets/js/socket.io/socket.io.min.js +2 -2
- package/assets/js/socket.io/socket.io.min.js.map +1 -1
- package/assets/js/socket.io/socket.io.msgpack.min.js +2 -2
- package/assets/js/socket.io/socket.io.msgpack.min.js.map +1 -1
- package/cdn.json +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Socket.IO v4.5.
|
|
2
|
+
* Socket.IO v4.5.4
|
|
3
3
|
* (c) 2014-2022 Guillermo Rauch
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -12,17 +12,11 @@
|
|
|
12
12
|
function _typeof(obj) {
|
|
13
13
|
"@babel/helpers - typeof";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
_typeof = function (obj) {
|
|
21
|
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return _typeof(obj);
|
|
15
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
16
|
+
return typeof obj;
|
|
17
|
+
} : function (obj) {
|
|
18
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
19
|
+
}, _typeof(obj);
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -44,11 +38,14 @@
|
|
|
44
38
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
45
39
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
46
40
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
41
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
42
|
+
writable: false
|
|
43
|
+
});
|
|
47
44
|
return Constructor;
|
|
48
45
|
}
|
|
49
46
|
|
|
50
47
|
function _extends() {
|
|
51
|
-
_extends = Object.assign
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
52
49
|
for (var i = 1; i < arguments.length; i++) {
|
|
53
50
|
var source = arguments[i];
|
|
54
51
|
|
|
@@ -61,7 +58,6 @@
|
|
|
61
58
|
|
|
62
59
|
return target;
|
|
63
60
|
};
|
|
64
|
-
|
|
65
61
|
return _extends.apply(this, arguments);
|
|
66
62
|
}
|
|
67
63
|
|
|
@@ -77,22 +73,24 @@
|
|
|
77
73
|
configurable: true
|
|
78
74
|
}
|
|
79
75
|
});
|
|
76
|
+
Object.defineProperty(subClass, "prototype", {
|
|
77
|
+
writable: false
|
|
78
|
+
});
|
|
80
79
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
function _getPrototypeOf(o) {
|
|
84
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
83
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
85
84
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
86
85
|
};
|
|
87
86
|
return _getPrototypeOf(o);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
function _setPrototypeOf(o, p) {
|
|
91
|
-
_setPrototypeOf = Object.setPrototypeOf
|
|
90
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
92
91
|
o.__proto__ = p;
|
|
93
92
|
return o;
|
|
94
93
|
};
|
|
95
|
-
|
|
96
94
|
return _setPrototypeOf(o, p);
|
|
97
95
|
}
|
|
98
96
|
|
|
@@ -111,7 +109,7 @@
|
|
|
111
109
|
|
|
112
110
|
function _construct(Parent, args, Class) {
|
|
113
111
|
if (_isNativeReflectConstruct()) {
|
|
114
|
-
_construct = Reflect.construct;
|
|
112
|
+
_construct = Reflect.construct.bind();
|
|
115
113
|
} else {
|
|
116
114
|
_construct = function _construct(Parent, args, Class) {
|
|
117
115
|
var a = [null];
|
|
@@ -210,9 +208,9 @@
|
|
|
210
208
|
return object;
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
function _get(
|
|
211
|
+
function _get() {
|
|
214
212
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
215
|
-
_get = Reflect.get;
|
|
213
|
+
_get = Reflect.get.bind();
|
|
216
214
|
} else {
|
|
217
215
|
_get = function _get(target, property, receiver) {
|
|
218
216
|
var base = _superPropBase(target, property);
|
|
@@ -221,14 +219,14 @@
|
|
|
221
219
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
222
220
|
|
|
223
221
|
if (desc.get) {
|
|
224
|
-
return desc.get.call(receiver);
|
|
222
|
+
return desc.get.call(arguments.length < 3 ? target : receiver);
|
|
225
223
|
}
|
|
226
224
|
|
|
227
225
|
return desc.value;
|
|
228
226
|
};
|
|
229
227
|
}
|
|
230
228
|
|
|
231
|
-
return _get(
|
|
229
|
+
return _get.apply(this, arguments);
|
|
232
230
|
}
|
|
233
231
|
|
|
234
232
|
function _unsupportedIterableToArray(o, minLen) {
|
|
@@ -363,11 +361,6 @@
|
|
|
363
361
|
return fileReader.readAsDataURL(data);
|
|
364
362
|
};
|
|
365
363
|
|
|
366
|
-
/*
|
|
367
|
-
* base64-arraybuffer 1.0.1 <https://github.com/niklasvh/base64-arraybuffer>
|
|
368
|
-
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
369
|
-
* Released under MIT License
|
|
370
|
-
*/
|
|
371
364
|
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; // Use a lookup table to find the index.
|
|
372
365
|
|
|
373
366
|
var lookup$1 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
|
|
@@ -375,7 +368,6 @@
|
|
|
375
368
|
for (var i$1 = 0; i$1 < chars.length; i$1++) {
|
|
376
369
|
lookup$1[chars.charCodeAt(i$1)] = i$1;
|
|
377
370
|
}
|
|
378
|
-
|
|
379
371
|
var decode$1 = function decode(base64) {
|
|
380
372
|
var bufferLength = base64.length * 0.75,
|
|
381
373
|
len = base64.length,
|
|
@@ -667,7 +659,7 @@
|
|
|
667
659
|
return !!this.listeners(event).length;
|
|
668
660
|
};
|
|
669
661
|
|
|
670
|
-
var
|
|
662
|
+
var globalThisShim = function () {
|
|
671
663
|
if (typeof self !== "undefined") {
|
|
672
664
|
return self;
|
|
673
665
|
} else if (typeof window !== "undefined") {
|
|
@@ -675,7 +667,7 @@
|
|
|
675
667
|
} else {
|
|
676
668
|
return Function("return this")();
|
|
677
669
|
}
|
|
678
|
-
}
|
|
670
|
+
}();
|
|
679
671
|
|
|
680
672
|
function pick(obj) {
|
|
681
673
|
for (var _len = arguments.length, attr = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -695,11 +687,11 @@
|
|
|
695
687
|
var NATIVE_CLEAR_TIMEOUT = clearTimeout;
|
|
696
688
|
function installTimerFunctions(obj, opts) {
|
|
697
689
|
if (opts.useNativeTimers) {
|
|
698
|
-
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(
|
|
699
|
-
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(
|
|
690
|
+
obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThisShim);
|
|
691
|
+
obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThisShim);
|
|
700
692
|
} else {
|
|
701
|
-
obj.setTimeoutFn = setTimeout.bind(
|
|
702
|
-
obj.clearTimeoutFn = clearTimeout.bind(
|
|
693
|
+
obj.setTimeoutFn = setTimeout.bind(globalThisShim);
|
|
694
|
+
obj.clearTimeoutFn = clearTimeout.bind(globalThisShim);
|
|
703
695
|
}
|
|
704
696
|
} // base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)
|
|
705
697
|
|
|
@@ -753,7 +745,7 @@
|
|
|
753
745
|
return _this;
|
|
754
746
|
}
|
|
755
747
|
|
|
756
|
-
return TransportError;
|
|
748
|
+
return _createClass(TransportError);
|
|
757
749
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
758
750
|
|
|
759
751
|
var Transport = /*#__PURE__*/function (_Emitter) {
|
|
@@ -998,7 +990,7 @@
|
|
|
998
990
|
var hasCORS = value;
|
|
999
991
|
|
|
1000
992
|
// browser shim for xmlhttprequest module
|
|
1001
|
-
function
|
|
993
|
+
function XHR(opts) {
|
|
1002
994
|
var xdomain = opts.xdomain; // XMLHttpRequest can be disabled on IE
|
|
1003
995
|
|
|
1004
996
|
try {
|
|
@@ -1009,7 +1001,7 @@
|
|
|
1009
1001
|
|
|
1010
1002
|
if (!xdomain) {
|
|
1011
1003
|
try {
|
|
1012
|
-
return new
|
|
1004
|
+
return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP");
|
|
1013
1005
|
} catch (e) {}
|
|
1014
1006
|
}
|
|
1015
1007
|
}
|
|
@@ -1017,7 +1009,7 @@
|
|
|
1017
1009
|
function empty() {}
|
|
1018
1010
|
|
|
1019
1011
|
var hasXHR2 = function () {
|
|
1020
|
-
var xhr = new
|
|
1012
|
+
var xhr = new XHR({
|
|
1021
1013
|
xdomain: false
|
|
1022
1014
|
});
|
|
1023
1015
|
return null != xhr.responseType;
|
|
@@ -1362,7 +1354,7 @@
|
|
|
1362
1354
|
var opts = pick(this.opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
|
|
1363
1355
|
opts.xdomain = !!this.opts.xd;
|
|
1364
1356
|
opts.xscheme = !!this.opts.xs;
|
|
1365
|
-
var xhr = this.xhr = new
|
|
1357
|
+
var xhr = this.xhr = new XHR(opts);
|
|
1366
1358
|
|
|
1367
1359
|
try {
|
|
1368
1360
|
xhr.open(this.method, this.uri, this.async);
|
|
@@ -1513,7 +1505,7 @@
|
|
|
1513
1505
|
// @ts-ignore
|
|
1514
1506
|
attachEvent("onunload", unloadHandler);
|
|
1515
1507
|
} else if (typeof addEventListener === "function") {
|
|
1516
|
-
var terminationEvent = "onpagehide" in
|
|
1508
|
+
var terminationEvent = "onpagehide" in globalThisShim ? "pagehide" : "unload";
|
|
1517
1509
|
addEventListener(terminationEvent, unloadHandler, false);
|
|
1518
1510
|
}
|
|
1519
1511
|
}
|
|
@@ -1539,7 +1531,7 @@
|
|
|
1539
1531
|
};
|
|
1540
1532
|
}
|
|
1541
1533
|
}();
|
|
1542
|
-
var WebSocket =
|
|
1534
|
+
var WebSocket = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
|
|
1543
1535
|
var usingBrowserWebSocket = true;
|
|
1544
1536
|
var defaultBinaryType = "arraybuffer";
|
|
1545
1537
|
|
|
@@ -1745,7 +1737,7 @@
|
|
|
1745
1737
|
}, {
|
|
1746
1738
|
key: "check",
|
|
1747
1739
|
value: function check() {
|
|
1748
|
-
return !!WebSocket
|
|
1740
|
+
return !!WebSocket;
|
|
1749
1741
|
}
|
|
1750
1742
|
}]);
|
|
1751
1743
|
|
|
@@ -1800,11 +1792,11 @@
|
|
|
1800
1792
|
var regx = /\/{2,9}/g,
|
|
1801
1793
|
names = path.replace(regx, "/").split("/");
|
|
1802
1794
|
|
|
1803
|
-
if (path.
|
|
1795
|
+
if (path.slice(0, 1) == '/' || path.length === 0) {
|
|
1804
1796
|
names.splice(0, 1);
|
|
1805
1797
|
}
|
|
1806
1798
|
|
|
1807
|
-
if (path.
|
|
1799
|
+
if (path.slice(-1) == '/') {
|
|
1808
1800
|
names.splice(names.length - 1, 1);
|
|
1809
1801
|
}
|
|
1810
1802
|
|
|
@@ -1904,14 +1896,16 @@
|
|
|
1904
1896
|
// Firefox closes the connection when the "beforeunload" event is emitted but not Chrome. This event listener
|
|
1905
1897
|
// ensures every browser behaves the same (no "disconnect" event at the Socket.IO level when the page is
|
|
1906
1898
|
// closed/reloaded)
|
|
1907
|
-
|
|
1899
|
+
_this.beforeunloadEventListener = function () {
|
|
1908
1900
|
if (_this.transport) {
|
|
1909
1901
|
// silently close the transport
|
|
1910
1902
|
_this.transport.removeAllListeners();
|
|
1911
1903
|
|
|
1912
1904
|
_this.transport.close();
|
|
1913
1905
|
}
|
|
1914
|
-
}
|
|
1906
|
+
};
|
|
1907
|
+
|
|
1908
|
+
addEventListener("beforeunload", _this.beforeunloadEventListener, false);
|
|
1915
1909
|
}
|
|
1916
1910
|
|
|
1917
1911
|
if (_this.hostname !== "localhost") {
|
|
@@ -2459,6 +2453,7 @@
|
|
|
2459
2453
|
this.transport.removeAllListeners();
|
|
2460
2454
|
|
|
2461
2455
|
if (typeof removeEventListener === "function") {
|
|
2456
|
+
removeEventListener("beforeunload", this.beforeunloadEventListener, false);
|
|
2462
2457
|
removeEventListener("offline", this.offlineEventListener, false);
|
|
2463
2458
|
} // set ready state
|
|
2464
2459
|
|
|
@@ -2501,6 +2496,8 @@
|
|
|
2501
2496
|
}(Emitter);
|
|
2502
2497
|
Socket$1.protocol = protocol$1;
|
|
2503
2498
|
|
|
2499
|
+
Socket$1.protocol;
|
|
2500
|
+
|
|
2504
2501
|
/**
|
|
2505
2502
|
* URL parser.
|
|
2506
2503
|
*
|
|
@@ -2682,8 +2679,14 @@
|
|
|
2682
2679
|
function _reconstructPacket(data, buffers) {
|
|
2683
2680
|
if (!data) return data;
|
|
2684
2681
|
|
|
2685
|
-
if (data && data._placeholder) {
|
|
2686
|
-
|
|
2682
|
+
if (data && data._placeholder === true) {
|
|
2683
|
+
var isIndexValid = typeof data.num === "number" && data.num >= 0 && data.num < buffers.length;
|
|
2684
|
+
|
|
2685
|
+
if (isIndexValid) {
|
|
2686
|
+
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
|
|
2687
|
+
} else {
|
|
2688
|
+
throw new Error("illegal attachments");
|
|
2689
|
+
}
|
|
2687
2690
|
} else if (Array.isArray(data)) {
|
|
2688
2691
|
for (var i = 0; i < data.length; i++) {
|
|
2689
2692
|
data[i] = _reconstructPacket(data[i], buffers);
|
|
@@ -2843,6 +2846,10 @@
|
|
|
2843
2846
|
var packet;
|
|
2844
2847
|
|
|
2845
2848
|
if (typeof obj === "string") {
|
|
2849
|
+
if (this.reconstructor) {
|
|
2850
|
+
throw new Error("got plaintext data when reconstructing a packet");
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2846
2853
|
packet = this.decodeString(obj);
|
|
2847
2854
|
|
|
2848
2855
|
if (packet.type === PacketType.BINARY_EVENT || packet.type === PacketType.BINARY_ACK) {
|
|
@@ -3088,6 +3095,31 @@
|
|
|
3088
3095
|
newListener: 1,
|
|
3089
3096
|
removeListener: 1
|
|
3090
3097
|
});
|
|
3098
|
+
/**
|
|
3099
|
+
* A Socket is the fundamental class for interacting with the server.
|
|
3100
|
+
*
|
|
3101
|
+
* A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.
|
|
3102
|
+
*
|
|
3103
|
+
* @example
|
|
3104
|
+
* const socket = io();
|
|
3105
|
+
*
|
|
3106
|
+
* socket.on("connect", () => {
|
|
3107
|
+
* console.log("connected");
|
|
3108
|
+
* });
|
|
3109
|
+
*
|
|
3110
|
+
* // send an event to the server
|
|
3111
|
+
* socket.emit("foo", "bar");
|
|
3112
|
+
*
|
|
3113
|
+
* socket.on("foobar", () => {
|
|
3114
|
+
* // an event was received from the server
|
|
3115
|
+
* });
|
|
3116
|
+
*
|
|
3117
|
+
* // upon disconnection
|
|
3118
|
+
* socket.on("disconnect", (reason) => {
|
|
3119
|
+
* console.log(`disconnected due to ${reason}`);
|
|
3120
|
+
* });
|
|
3121
|
+
*/
|
|
3122
|
+
|
|
3091
3123
|
var Socket = /*#__PURE__*/function (_Emitter) {
|
|
3092
3124
|
_inherits(Socket, _Emitter);
|
|
3093
3125
|
|
|
@@ -3095,8 +3127,6 @@
|
|
|
3095
3127
|
|
|
3096
3128
|
/**
|
|
3097
3129
|
* `Socket` constructor.
|
|
3098
|
-
*
|
|
3099
|
-
* @public
|
|
3100
3130
|
*/
|
|
3101
3131
|
function Socket(io, nsp, opts) {
|
|
3102
3132
|
var _this;
|
|
@@ -3104,8 +3134,31 @@
|
|
|
3104
3134
|
_classCallCheck(this, Socket);
|
|
3105
3135
|
|
|
3106
3136
|
_this = _super.call(this);
|
|
3137
|
+
/**
|
|
3138
|
+
* Whether the socket is currently connected to the server.
|
|
3139
|
+
*
|
|
3140
|
+
* @example
|
|
3141
|
+
* const socket = io();
|
|
3142
|
+
*
|
|
3143
|
+
* socket.on("connect", () => {
|
|
3144
|
+
* console.log(socket.connected); // true
|
|
3145
|
+
* });
|
|
3146
|
+
*
|
|
3147
|
+
* socket.on("disconnect", () => {
|
|
3148
|
+
* console.log(socket.connected); // false
|
|
3149
|
+
* });
|
|
3150
|
+
*/
|
|
3151
|
+
|
|
3107
3152
|
_this.connected = false;
|
|
3153
|
+
/**
|
|
3154
|
+
* Buffer for packets received before the CONNECT packet
|
|
3155
|
+
*/
|
|
3156
|
+
|
|
3108
3157
|
_this.receiveBuffer = [];
|
|
3158
|
+
/**
|
|
3159
|
+
* Buffer for packets that will be sent once the socket is connected
|
|
3160
|
+
*/
|
|
3161
|
+
|
|
3109
3162
|
_this.sendBuffer = [];
|
|
3110
3163
|
_this.ids = 0;
|
|
3111
3164
|
_this.acks = {};
|
|
@@ -3122,6 +3175,17 @@
|
|
|
3122
3175
|
}
|
|
3123
3176
|
/**
|
|
3124
3177
|
* Whether the socket is currently disconnected
|
|
3178
|
+
*
|
|
3179
|
+
* @example
|
|
3180
|
+
* const socket = io();
|
|
3181
|
+
*
|
|
3182
|
+
* socket.on("connect", () => {
|
|
3183
|
+
* console.log(socket.disconnected); // false
|
|
3184
|
+
* });
|
|
3185
|
+
*
|
|
3186
|
+
* socket.on("disconnect", () => {
|
|
3187
|
+
* console.log(socket.disconnected); // true
|
|
3188
|
+
* });
|
|
3125
3189
|
*/
|
|
3126
3190
|
|
|
3127
3191
|
|
|
@@ -3144,7 +3208,21 @@
|
|
|
3144
3208
|
this.subs = [on(io, "open", this.onopen.bind(this)), on(io, "packet", this.onpacket.bind(this)), on(io, "error", this.onerror.bind(this)), on(io, "close", this.onclose.bind(this))];
|
|
3145
3209
|
}
|
|
3146
3210
|
/**
|
|
3147
|
-
* Whether the Socket will try to reconnect when its Manager connects or reconnects
|
|
3211
|
+
* Whether the Socket will try to reconnect when its Manager connects or reconnects.
|
|
3212
|
+
*
|
|
3213
|
+
* @example
|
|
3214
|
+
* const socket = io();
|
|
3215
|
+
*
|
|
3216
|
+
* console.log(socket.active); // true
|
|
3217
|
+
*
|
|
3218
|
+
* socket.on("disconnect", (reason) => {
|
|
3219
|
+
* if (reason === "io server disconnect") {
|
|
3220
|
+
* // the disconnection was initiated by the server, you need to manually reconnect
|
|
3221
|
+
* console.log(socket.active); // false
|
|
3222
|
+
* }
|
|
3223
|
+
* // else the socket will automatically try to reconnect
|
|
3224
|
+
* console.log(socket.active); // true
|
|
3225
|
+
* });
|
|
3148
3226
|
*/
|
|
3149
3227
|
|
|
3150
3228
|
}, {
|
|
@@ -3155,7 +3233,12 @@
|
|
|
3155
3233
|
/**
|
|
3156
3234
|
* "Opens" the socket.
|
|
3157
3235
|
*
|
|
3158
|
-
* @
|
|
3236
|
+
* @example
|
|
3237
|
+
* const socket = io({
|
|
3238
|
+
* autoConnect: false
|
|
3239
|
+
* });
|
|
3240
|
+
*
|
|
3241
|
+
* socket.connect();
|
|
3159
3242
|
*/
|
|
3160
3243
|
|
|
3161
3244
|
}, {
|
|
@@ -3169,7 +3252,7 @@
|
|
|
3169
3252
|
return this;
|
|
3170
3253
|
}
|
|
3171
3254
|
/**
|
|
3172
|
-
* Alias for connect()
|
|
3255
|
+
* Alias for {@link connect()}.
|
|
3173
3256
|
*/
|
|
3174
3257
|
|
|
3175
3258
|
}, {
|
|
@@ -3180,8 +3263,17 @@
|
|
|
3180
3263
|
/**
|
|
3181
3264
|
* Sends a `message` event.
|
|
3182
3265
|
*
|
|
3266
|
+
* This method mimics the WebSocket.send() method.
|
|
3267
|
+
*
|
|
3268
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
|
|
3269
|
+
*
|
|
3270
|
+
* @example
|
|
3271
|
+
* socket.send("hello");
|
|
3272
|
+
*
|
|
3273
|
+
* // this is equivalent to
|
|
3274
|
+
* socket.emit("message", "hello");
|
|
3275
|
+
*
|
|
3183
3276
|
* @return self
|
|
3184
|
-
* @public
|
|
3185
3277
|
*/
|
|
3186
3278
|
|
|
3187
3279
|
}, {
|
|
@@ -3199,15 +3291,25 @@
|
|
|
3199
3291
|
* Override `emit`.
|
|
3200
3292
|
* If the event is in `events`, it's emitted normally.
|
|
3201
3293
|
*
|
|
3294
|
+
* @example
|
|
3295
|
+
* socket.emit("hello", "world");
|
|
3296
|
+
*
|
|
3297
|
+
* // all serializable datastructures are supported (no need to call JSON.stringify)
|
|
3298
|
+
* socket.emit("hello", 1, "2", { 3: ["4"], 5: Uint8Array.from([6]) });
|
|
3299
|
+
*
|
|
3300
|
+
* // with an acknowledgement from the server
|
|
3301
|
+
* socket.emit("hello", "world", (val) => {
|
|
3302
|
+
* // ...
|
|
3303
|
+
* });
|
|
3304
|
+
*
|
|
3202
3305
|
* @return self
|
|
3203
|
-
* @public
|
|
3204
3306
|
*/
|
|
3205
3307
|
|
|
3206
3308
|
}, {
|
|
3207
3309
|
key: "emit",
|
|
3208
3310
|
value: function emit(ev) {
|
|
3209
3311
|
if (RESERVED_EVENTS.hasOwnProperty(ev)) {
|
|
3210
|
-
throw new Error('"' + ev + '" is a reserved event name');
|
|
3312
|
+
throw new Error('"' + ev.toString() + '" is a reserved event name');
|
|
3211
3313
|
}
|
|
3212
3314
|
|
|
3213
3315
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
@@ -3558,10 +3660,20 @@
|
|
|
3558
3660
|
this.io["_destroy"](this);
|
|
3559
3661
|
}
|
|
3560
3662
|
/**
|
|
3561
|
-
* Disconnects the socket manually.
|
|
3663
|
+
* Disconnects the socket manually. In that case, the socket will not try to reconnect.
|
|
3664
|
+
*
|
|
3665
|
+
* If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.
|
|
3666
|
+
*
|
|
3667
|
+
* @example
|
|
3668
|
+
* const socket = io();
|
|
3669
|
+
*
|
|
3670
|
+
* socket.on("disconnect", (reason) => {
|
|
3671
|
+
* // console.log(reason); prints "io client disconnect"
|
|
3672
|
+
* });
|
|
3673
|
+
*
|
|
3674
|
+
* socket.disconnect();
|
|
3562
3675
|
*
|
|
3563
3676
|
* @return self
|
|
3564
|
-
* @public
|
|
3565
3677
|
*/
|
|
3566
3678
|
|
|
3567
3679
|
}, {
|
|
@@ -3584,10 +3696,9 @@
|
|
|
3584
3696
|
return this;
|
|
3585
3697
|
}
|
|
3586
3698
|
/**
|
|
3587
|
-
* Alias for disconnect()
|
|
3699
|
+
* Alias for {@link disconnect()}.
|
|
3588
3700
|
*
|
|
3589
3701
|
* @return self
|
|
3590
|
-
* @public
|
|
3591
3702
|
*/
|
|
3592
3703
|
|
|
3593
3704
|
}, {
|
|
@@ -3598,9 +3709,11 @@
|
|
|
3598
3709
|
/**
|
|
3599
3710
|
* Sets the compress flag.
|
|
3600
3711
|
*
|
|
3712
|
+
* @example
|
|
3713
|
+
* socket.compress(false).emit("hello");
|
|
3714
|
+
*
|
|
3601
3715
|
* @param compress - if `true`, compresses the sending data
|
|
3602
3716
|
* @return self
|
|
3603
|
-
* @public
|
|
3604
3717
|
*/
|
|
3605
3718
|
|
|
3606
3719
|
}, {
|
|
@@ -3613,8 +3726,10 @@
|
|
|
3613
3726
|
* Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not
|
|
3614
3727
|
* ready to send messages.
|
|
3615
3728
|
*
|
|
3729
|
+
* @example
|
|
3730
|
+
* socket.volatile.emit("hello"); // the server may or may not receive it
|
|
3731
|
+
*
|
|
3616
3732
|
* @returns self
|
|
3617
|
-
* @public
|
|
3618
3733
|
*/
|
|
3619
3734
|
|
|
3620
3735
|
}, {
|
|
@@ -3627,16 +3742,14 @@
|
|
|
3627
3742
|
* Sets a modifier for a subsequent event emission that the callback will be called with an error when the
|
|
3628
3743
|
* given number of milliseconds have elapsed without an acknowledgement from the server:
|
|
3629
3744
|
*
|
|
3630
|
-
*
|
|
3745
|
+
* @example
|
|
3631
3746
|
* socket.timeout(5000).emit("my-event", (err) => {
|
|
3632
3747
|
* if (err) {
|
|
3633
3748
|
* // the server did not acknowledge the event in the given delay
|
|
3634
3749
|
* }
|
|
3635
3750
|
* });
|
|
3636
|
-
* ```
|
|
3637
3751
|
*
|
|
3638
3752
|
* @returns self
|
|
3639
|
-
* @public
|
|
3640
3753
|
*/
|
|
3641
3754
|
|
|
3642
3755
|
}, {
|
|
@@ -3649,8 +3762,12 @@
|
|
|
3649
3762
|
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
|
|
3650
3763
|
* callback.
|
|
3651
3764
|
*
|
|
3765
|
+
* @example
|
|
3766
|
+
* socket.onAny((event, ...args) => {
|
|
3767
|
+
* console.log(`got ${event}`);
|
|
3768
|
+
* });
|
|
3769
|
+
*
|
|
3652
3770
|
* @param listener
|
|
3653
|
-
* @public
|
|
3654
3771
|
*/
|
|
3655
3772
|
|
|
3656
3773
|
}, {
|
|
@@ -3666,8 +3783,12 @@
|
|
|
3666
3783
|
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
|
|
3667
3784
|
* callback. The listener is added to the beginning of the listeners array.
|
|
3668
3785
|
*
|
|
3786
|
+
* @example
|
|
3787
|
+
* socket.prependAny((event, ...args) => {
|
|
3788
|
+
* console.log(`got event ${event}`);
|
|
3789
|
+
* });
|
|
3790
|
+
*
|
|
3669
3791
|
* @param listener
|
|
3670
|
-
* @public
|
|
3671
3792
|
*/
|
|
3672
3793
|
|
|
3673
3794
|
}, {
|
|
@@ -3682,8 +3803,20 @@
|
|
|
3682
3803
|
/**
|
|
3683
3804
|
* Removes the listener that will be fired when any event is emitted.
|
|
3684
3805
|
*
|
|
3806
|
+
* @example
|
|
3807
|
+
* const catchAllListener = (event, ...args) => {
|
|
3808
|
+
* console.log(`got event ${event}`);
|
|
3809
|
+
* }
|
|
3810
|
+
*
|
|
3811
|
+
* socket.onAny(catchAllListener);
|
|
3812
|
+
*
|
|
3813
|
+
* // remove a specific listener
|
|
3814
|
+
* socket.offAny(catchAllListener);
|
|
3815
|
+
*
|
|
3816
|
+
* // or remove all listeners
|
|
3817
|
+
* socket.offAny();
|
|
3818
|
+
*
|
|
3685
3819
|
* @param listener
|
|
3686
|
-
* @public
|
|
3687
3820
|
*/
|
|
3688
3821
|
|
|
3689
3822
|
}, {
|
|
@@ -3711,8 +3844,6 @@
|
|
|
3711
3844
|
/**
|
|
3712
3845
|
* Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
|
|
3713
3846
|
* e.g. to remove listeners.
|
|
3714
|
-
*
|
|
3715
|
-
* @public
|
|
3716
3847
|
*/
|
|
3717
3848
|
|
|
3718
3849
|
}, {
|
|
@@ -3724,17 +3855,14 @@
|
|
|
3724
3855
|
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
|
|
3725
3856
|
* callback.
|
|
3726
3857
|
*
|
|
3727
|
-
*
|
|
3728
|
-
*
|
|
3729
|
-
* <pre><code>
|
|
3858
|
+
* Note: acknowledgements sent to the server are not included.
|
|
3730
3859
|
*
|
|
3860
|
+
* @example
|
|
3731
3861
|
* socket.onAnyOutgoing((event, ...args) => {
|
|
3732
|
-
* console.log(event);
|
|
3862
|
+
* console.log(`sent event ${event}`);
|
|
3733
3863
|
* });
|
|
3734
3864
|
*
|
|
3735
|
-
*
|
|
3736
|
-
*
|
|
3737
|
-
* @public
|
|
3865
|
+
* @param listener
|
|
3738
3866
|
*/
|
|
3739
3867
|
|
|
3740
3868
|
}, {
|
|
@@ -3750,17 +3878,14 @@
|
|
|
3750
3878
|
* Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
|
|
3751
3879
|
* callback. The listener is added to the beginning of the listeners array.
|
|
3752
3880
|
*
|
|
3753
|
-
*
|
|
3754
|
-
*
|
|
3755
|
-
* <pre><code>
|
|
3881
|
+
* Note: acknowledgements sent to the server are not included.
|
|
3756
3882
|
*
|
|
3883
|
+
* @example
|
|
3757
3884
|
* socket.prependAnyOutgoing((event, ...args) => {
|
|
3758
|
-
* console.log(event);
|
|
3885
|
+
* console.log(`sent event ${event}`);
|
|
3759
3886
|
* });
|
|
3760
3887
|
*
|
|
3761
|
-
*
|
|
3762
|
-
*
|
|
3763
|
-
* @public
|
|
3888
|
+
* @param listener
|
|
3764
3889
|
*/
|
|
3765
3890
|
|
|
3766
3891
|
}, {
|
|
@@ -3775,22 +3900,20 @@
|
|
|
3775
3900
|
/**
|
|
3776
3901
|
* Removes the listener that will be fired when any event is emitted.
|
|
3777
3902
|
*
|
|
3778
|
-
* @
|
|
3779
|
-
*
|
|
3780
|
-
*
|
|
3781
|
-
*
|
|
3782
|
-
* const handler = (event, ...args) => {
|
|
3783
|
-
* console.log(event);
|
|
3903
|
+
* @example
|
|
3904
|
+
* const catchAllListener = (event, ...args) => {
|
|
3905
|
+
* console.log(`sent event ${event}`);
|
|
3784
3906
|
* }
|
|
3785
3907
|
*
|
|
3786
|
-
* socket.onAnyOutgoing(
|
|
3908
|
+
* socket.onAnyOutgoing(catchAllListener);
|
|
3787
3909
|
*
|
|
3788
|
-
* //
|
|
3789
|
-
* socket.offAnyOutgoing(
|
|
3910
|
+
* // remove a specific listener
|
|
3911
|
+
* socket.offAnyOutgoing(catchAllListener);
|
|
3790
3912
|
*
|
|
3791
|
-
*
|
|
3913
|
+
* // or remove all listeners
|
|
3914
|
+
* socket.offAnyOutgoing();
|
|
3792
3915
|
*
|
|
3793
|
-
* @
|
|
3916
|
+
* @param [listener] - the catch-all listener (optional)
|
|
3794
3917
|
*/
|
|
3795
3918
|
|
|
3796
3919
|
}, {
|
|
@@ -3818,8 +3941,6 @@
|
|
|
3818
3941
|
/**
|
|
3819
3942
|
* Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
|
|
3820
3943
|
* e.g. to remove listeners.
|
|
3821
|
-
*
|
|
3822
|
-
* @public
|
|
3823
3944
|
*/
|
|
3824
3945
|
|
|
3825
3946
|
}, {
|
|
@@ -4179,7 +4300,11 @@
|
|
|
4179
4300
|
}, {
|
|
4180
4301
|
key: "ondata",
|
|
4181
4302
|
value: function ondata(data) {
|
|
4182
|
-
|
|
4303
|
+
try {
|
|
4304
|
+
this.decoder.add(data);
|
|
4305
|
+
} catch (e) {
|
|
4306
|
+
this.onclose("parse error", e);
|
|
4307
|
+
}
|
|
4183
4308
|
}
|
|
4184
4309
|
/**
|
|
4185
4310
|
* Called when parser fully decodes a packet.
|
|
@@ -4190,7 +4315,12 @@
|
|
|
4190
4315
|
}, {
|
|
4191
4316
|
key: "ondecoded",
|
|
4192
4317
|
value: function ondecoded(packet) {
|
|
4193
|
-
this
|
|
4318
|
+
var _this3 = this;
|
|
4319
|
+
|
|
4320
|
+
// the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a "parse error"
|
|
4321
|
+
nextTick(function () {
|
|
4322
|
+
_this3.emitReserved("packet", packet);
|
|
4323
|
+
}, this.setTimeoutFn);
|
|
4194
4324
|
}
|
|
4195
4325
|
/**
|
|
4196
4326
|
* Called upon socket error.
|
|
@@ -4328,7 +4458,7 @@
|
|
|
4328
4458
|
}, {
|
|
4329
4459
|
key: "reconnect",
|
|
4330
4460
|
value: function reconnect() {
|
|
4331
|
-
var
|
|
4461
|
+
var _this4 = this;
|
|
4332
4462
|
|
|
4333
4463
|
if (this._reconnecting || this.skipReconnect) return this;
|
|
4334
4464
|
var self = this;
|
|
@@ -4343,7 +4473,7 @@
|
|
|
4343
4473
|
var timer = this.setTimeoutFn(function () {
|
|
4344
4474
|
if (self.skipReconnect) return;
|
|
4345
4475
|
|
|
4346
|
-
|
|
4476
|
+
_this4.emitReserved("reconnect_attempt", self.backoff.attempts); // check again for the case socket closed in above events
|
|
4347
4477
|
|
|
4348
4478
|
|
|
4349
4479
|
if (self.skipReconnect) return;
|
|
@@ -4352,7 +4482,7 @@
|
|
|
4352
4482
|
self._reconnecting = false;
|
|
4353
4483
|
self.reconnect();
|
|
4354
4484
|
|
|
4355
|
-
|
|
4485
|
+
_this4.emitReserved("reconnect_error", err);
|
|
4356
4486
|
} else {
|
|
4357
4487
|
self.onreconnect();
|
|
4358
4488
|
}
|