zmdms-utils 0.0.81 → 0.0.83

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.
Files changed (162) hide show
  1. package/dist/es/validate.js +168 -1
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +0 -1
  4. package/package.json +2 -6
  5. package/src/index.ts +0 -3
  6. package/src/validate.ts +198 -0
  7. package/dist/es/_virtual/FastBufferList.js +0 -7
  8. package/dist/es/_virtual/_commonjs-dynamic-modules.js +0 -5
  9. package/dist/es/_virtual/browser.js +0 -7
  10. package/dist/es/_virtual/browser2.js +0 -7
  11. package/dist/es/_virtual/debug.js +0 -7
  12. package/dist/es/_virtual/event.js +0 -7
  13. package/dist/es/_virtual/http-parser.js +0 -3
  14. package/dist/es/_virtual/iframe.js +0 -7
  15. package/dist/es/_virtual/index.js +0 -7
  16. package/dist/es/_virtual/index2.js +0 -7
  17. package/dist/es/_virtual/index3.js +0 -7
  18. package/dist/es/_virtual/index4.js +0 -7
  19. package/dist/es/_virtual/index5.js +0 -7
  20. package/dist/es/_virtual/index6.js +0 -7
  21. package/dist/es/_virtual/index7.js +0 -3
  22. package/dist/es/_virtual/index8.js +0 -7
  23. package/dist/es/_virtual/index9.js +0 -7
  24. package/dist/es/_virtual/inherits.js +0 -7
  25. package/dist/es/_virtual/inherits_browser.js +0 -7
  26. package/dist/es/_virtual/json3.js +0 -7
  27. package/dist/es/_virtual/node.js +0 -7
  28. package/dist/es/_virtual/node2.js +0 -7
  29. package/dist/es/_virtual/stomp-node.js +0 -3
  30. package/dist/es/_virtual/stomp.js +0 -3
  31. package/dist/es/_virtual/streams.js +0 -3
  32. package/dist/es/_virtual/utils.js +0 -3
  33. package/dist/es/node_modules/bufferutil/fallback.js +0 -43
  34. package/dist/es/node_modules/bufferutil/index.js +0 -21
  35. package/dist/es/node_modules/debug/src/browser.js +0 -192
  36. package/dist/es/node_modules/debug/src/common.js +0 -259
  37. package/dist/es/node_modules/debug/src/index.js +0 -25
  38. package/dist/es/node_modules/debug/src/node.js +0 -192
  39. package/dist/es/node_modules/eventsource/lib/eventsource.js +0 -493
  40. package/dist/es/node_modules/faye-websocket/lib/faye/eventsource.js +0 -150
  41. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event.js +0 -31
  42. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js +0 -41
  43. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api.js +0 -205
  44. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/client.js +0 -107
  45. package/dist/es/node_modules/faye-websocket/lib/faye/websocket.js +0 -47
  46. package/dist/es/node_modules/has-flag/index.js +0 -17
  47. package/dist/es/node_modules/http-parser-js/http-parser.js +0 -471
  48. package/dist/es/node_modules/inherits/inherits.js +0 -14
  49. package/dist/es/node_modules/inherits/inherits_browser.js +0 -38
  50. package/dist/es/node_modules/is-typedarray/index.js +0 -51
  51. package/dist/es/node_modules/json3/lib/json3.js +0 -937
  52. package/dist/es/node_modules/ms/index.js +0 -172
  53. package/dist/es/node_modules/node-gyp-build/index.js +0 -21
  54. package/dist/es/node_modules/node-gyp-build/node-gyp-build.js +0 -222
  55. package/dist/es/node_modules/querystringify/index.js +0 -120
  56. package/dist/es/node_modules/requires-port/index.js +0 -38
  57. package/dist/es/node_modules/safe-buffer/index.js +0 -71
  58. package/dist/es/node_modules/supports-color/index.js +0 -143
  59. package/dist/es/node_modules/typedarray-to-buffer/index.js +0 -37
  60. package/dist/es/node_modules/url-parse/index.js +0 -594
  61. package/dist/es/node_modules/utf-8-validate/fallback.js +0 -71
  62. package/dist/es/node_modules/utf-8-validate/index.js +0 -21
  63. package/dist/es/node_modules/websocket/index.js +0 -15
  64. package/dist/es/node_modules/websocket/lib/Deprecation.js +0 -42
  65. package/dist/es/node_modules/websocket/lib/W3CWebSocket.js +0 -268
  66. package/dist/es/node_modules/websocket/lib/WebSocketClient.js +0 -380
  67. package/dist/es/node_modules/websocket/lib/WebSocketConnection.js +0 -914
  68. package/dist/es/node_modules/websocket/lib/WebSocketFrame.js +0 -293
  69. package/dist/es/node_modules/websocket/lib/WebSocketRequest.js +0 -543
  70. package/dist/es/node_modules/websocket/lib/WebSocketRouter.js +0 -172
  71. package/dist/es/node_modules/websocket/lib/WebSocketRouterRequest.js +0 -67
  72. package/dist/es/node_modules/websocket/lib/WebSocketServer.js +0 -272
  73. package/dist/es/node_modules/websocket/lib/utils.js +0 -80
  74. package/dist/es/node_modules/websocket/lib/version.js +0 -13
  75. package/dist/es/node_modules/websocket/lib/websocket.js +0 -31
  76. package/dist/es/node_modules/websocket/node_modules/debug/src/browser.js +0 -199
  77. package/dist/es/node_modules/websocket/node_modules/debug/src/debug.js +0 -215
  78. package/dist/es/node_modules/websocket/node_modules/debug/src/index.js +0 -25
  79. package/dist/es/node_modules/websocket/node_modules/debug/src/node.js +0 -266
  80. package/dist/es/node_modules/websocket/node_modules/ms/index.js +0 -162
  81. package/dist/es/node_modules/websocket/package.json.js +0 -77
  82. package/dist/es/node_modules/websocket/vendor/FastBufferList.js +0 -205
  83. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/base.js +0 -202
  84. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/client.js +0 -152
  85. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft75.js +0 -128
  86. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft76.js +0 -124
  87. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/headers.js +0 -44
  88. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js +0 -21
  89. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js +0 -37
  90. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi.js +0 -492
  91. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/proxy.js +0 -108
  92. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/server.js +0 -119
  93. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js +0 -72
  94. package/dist/es/node_modules/websocket-driver/lib/websocket/driver.js +0 -47
  95. package/dist/es/node_modules/websocket-driver/lib/websocket/http_parser.js +0 -140
  96. package/dist/es/node_modules/websocket-driver/lib/websocket/streams.js +0 -150
  97. package/dist/es/node_modules/websocket-extensions/lib/parser.js +0 -103
  98. package/dist/es/node_modules/websocket-extensions/lib/pipeline/cell.js +0 -56
  99. package/dist/es/node_modules/websocket-extensions/lib/pipeline/functor.js +0 -74
  100. package/dist/es/node_modules/websocket-extensions/lib/pipeline/index.js +0 -50
  101. package/dist/es/node_modules/websocket-extensions/lib/pipeline/pledge.js +0 -39
  102. package/dist/es/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js +0 -66
  103. package/dist/es/node_modules/websocket-extensions/lib/websocket_extensions.js +0 -165
  104. package/dist/es/node_modules/yaeti/index.js +0 -17
  105. package/dist/es/node_modules/yaeti/lib/Event.js +0 -24
  106. package/dist/es/node_modules/yaeti/lib/EventTarget.js +0 -130
  107. package/dist/es/node_modules/zt-sockjs-client/lib/entry.js +0 -14
  108. package/dist/es/node_modules/zt-sockjs-client/lib/event/close.js +0 -21
  109. package/dist/es/node_modules/zt-sockjs-client/lib/event/event.js +0 -22
  110. package/dist/es/node_modules/zt-sockjs-client/lib/event/eventtarget.js +0 -62
  111. package/dist/es/node_modules/zt-sockjs-client/lib/event/trans-message.js +0 -19
  112. package/dist/es/node_modules/zt-sockjs-client/lib/facade.js +0 -40
  113. package/dist/es/node_modules/zt-sockjs-client/lib/iframe-bootstrap.js +0 -122
  114. package/dist/es/node_modules/zt-sockjs-client/lib/info-ajax.js +0 -57
  115. package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe-receiver.js +0 -50
  116. package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe.js +0 -81
  117. package/dist/es/node_modules/zt-sockjs-client/lib/info-receiver.js +0 -101
  118. package/dist/es/node_modules/zt-sockjs-client/lib/location.js +0 -12
  119. package/dist/es/node_modules/zt-sockjs-client/lib/main.js +0 -413
  120. package/dist/es/node_modules/zt-sockjs-client/lib/shims.js +0 -449
  121. package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/websocket.js +0 -5
  122. package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/xhr.js +0 -80
  123. package/dist/es/node_modules/zt-sockjs-client/lib/transport/eventsource.js +0 -34
  124. package/dist/es/node_modules/zt-sockjs-client/lib/transport/htmlfile.js +0 -31
  125. package/dist/es/node_modules/zt-sockjs-client/lib/transport/iframe.js +0 -154
  126. package/dist/es/node_modules/zt-sockjs-client/lib/transport/jsonp-polling.js +0 -41
  127. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/ajax-based.js +0 -55
  128. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/buffered-sender.js +0 -92
  129. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/iframe-wrap.js +0 -39
  130. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/polling.js +0 -65
  131. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/sender-receiver.js +0 -52
  132. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/eventsource.js +0 -69
  133. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/htmlfile.js +0 -96
  134. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/jsonp.js +0 -193
  135. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/xhr.js +0 -75
  136. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/jsonp.js +0 -104
  137. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xdr.js +0 -113
  138. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-cors.js +0 -19
  139. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-fake.js +0 -28
  140. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-local.js +0 -21
  141. package/dist/es/node_modules/zt-sockjs-client/lib/transport/websocket.js +0 -108
  142. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-polling.js +0 -30
  143. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-streaming.js +0 -38
  144. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-polling.js +0 -40
  145. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-streaming.js +0 -50
  146. package/dist/es/node_modules/zt-sockjs-client/lib/transport-list.js +0 -28
  147. package/dist/es/node_modules/zt-sockjs-client/lib/utils/browser.js +0 -29
  148. package/dist/es/node_modules/zt-sockjs-client/lib/utils/escape.js +0 -53
  149. package/dist/es/node_modules/zt-sockjs-client/lib/utils/event.js +0 -78
  150. package/dist/es/node_modules/zt-sockjs-client/lib/utils/iframe.js +0 -205
  151. package/dist/es/node_modules/zt-sockjs-client/lib/utils/log.js +0 -20
  152. package/dist/es/node_modules/zt-sockjs-client/lib/utils/object.js +0 -24
  153. package/dist/es/node_modules/zt-sockjs-client/lib/utils/random.js +0 -30
  154. package/dist/es/node_modules/zt-sockjs-client/lib/utils/transport.js +0 -52
  155. package/dist/es/node_modules/zt-sockjs-client/lib/utils/url.js +0 -54
  156. package/dist/es/node_modules/zt-sockjs-client/lib/version.js +0 -11
  157. package/dist/es/node_modules/zt-stompjs/index.js +0 -23
  158. package/dist/es/node_modules/zt-stompjs/lib/stomp-node.js +0 -117
  159. package/dist/es/node_modules/zt-stompjs/lib/stomp.js +0 -536
  160. package/dist/es/stompClient.d.ts +0 -55
  161. package/dist/es/stompClient.js +0 -379
  162. package/src/stompClient.ts +0 -449
@@ -1,449 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // pulled specific shims from https://github.com/es-shims/es5-shim
4
-
5
- var ArrayPrototype = Array.prototype;
6
- var ObjectPrototype = Object.prototype;
7
- var FunctionPrototype = Function.prototype;
8
- var StringPrototype = String.prototype;
9
- var array_slice = ArrayPrototype.slice;
10
-
11
- var _toString = ObjectPrototype.toString;
12
- var isFunction = function (val) {
13
- return ObjectPrototype.toString.call(val) === '[object Function]';
14
- };
15
- var isArray = function isArray(obj) {
16
- return _toString.call(obj) === '[object Array]';
17
- };
18
- var isString = function isString(obj) {
19
- return _toString.call(obj) === '[object String]';
20
- };
21
-
22
- var supportsDescriptors = Object.defineProperty && (function () {
23
- try {
24
- Object.defineProperty({}, 'x', {});
25
- return true;
26
- } catch (e) { /* this is ES3 */
27
- return false;
28
- }
29
- }());
30
-
31
- // Define configurable, writable and non-enumerable props
32
- // if they don't exist.
33
- var defineProperty;
34
- if (supportsDescriptors) {
35
- defineProperty = function (object, name, method, forceAssign) {
36
- if (!forceAssign && (name in object)) { return; }
37
- Object.defineProperty(object, name, {
38
- configurable: true,
39
- enumerable: false,
40
- writable: true,
41
- value: method
42
- });
43
- };
44
- } else {
45
- defineProperty = function (object, name, method, forceAssign) {
46
- if (!forceAssign && (name in object)) { return; }
47
- object[name] = method;
48
- };
49
- }
50
- var defineProperties = function (object, map, forceAssign) {
51
- for (var name in map) {
52
- if (ObjectPrototype.hasOwnProperty.call(map, name)) {
53
- defineProperty(object, name, map[name], forceAssign);
54
- }
55
- }
56
- };
57
-
58
- var toObject = function (o) {
59
- if (o == null) { // this matches both null and undefined
60
- throw new TypeError("can't convert " + o + ' to object');
61
- }
62
- return Object(o);
63
- };
64
-
65
- //
66
- // Util
67
- // ======
68
- //
69
-
70
- // ES5 9.4
71
- // http://es5.github.com/#x9.4
72
- // http://jsperf.com/to-integer
73
-
74
- function toInteger(num) {
75
- var n = +num;
76
- if (n !== n) { // isNaN
77
- n = 0;
78
- } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
79
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
80
- }
81
- return n;
82
- }
83
-
84
- function ToUint32(x) {
85
- return x >>> 0;
86
- }
87
-
88
- //
89
- // Function
90
- // ========
91
- //
92
-
93
- // ES-5 15.3.4.5
94
- // http://es5.github.com/#x15.3.4.5
95
-
96
- function Empty() {}
97
-
98
- defineProperties(FunctionPrototype, {
99
- bind: function bind(that) { // .length is 1
100
- // 1. Let Target be the this value.
101
- var target = this;
102
- // 2. If IsCallable(Target) is false, throw a TypeError exception.
103
- if (!isFunction(target)) {
104
- throw new TypeError('Function.prototype.bind called on incompatible ' + target);
105
- }
106
- // 3. Let A be a new (possibly empty) internal list of all of the
107
- // argument values provided after thisArg (arg1, arg2 etc), in order.
108
- // XXX slicedArgs will stand in for "A" if used
109
- var args = array_slice.call(arguments, 1); // for normal call
110
- // 4. Let F be a new native ECMAScript object.
111
- // 11. Set the [[Prototype]] internal property of F to the standard
112
- // built-in Function prototype object as specified in 15.3.3.1.
113
- // 12. Set the [[Call]] internal property of F as described in
114
- // 15.3.4.5.1.
115
- // 13. Set the [[Construct]] internal property of F as described in
116
- // 15.3.4.5.2.
117
- // 14. Set the [[HasInstance]] internal property of F as described in
118
- // 15.3.4.5.3.
119
- var binder = function () {
120
-
121
- if (this instanceof bound) {
122
- // 15.3.4.5.2 [[Construct]]
123
- // When the [[Construct]] internal method of a function object,
124
- // F that was created using the bind function is called with a
125
- // list of arguments ExtraArgs, the following steps are taken:
126
- // 1. Let target be the value of F's [[TargetFunction]]
127
- // internal property.
128
- // 2. If target has no [[Construct]] internal method, a
129
- // TypeError exception is thrown.
130
- // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
131
- // property.
132
- // 4. Let args be a new list containing the same values as the
133
- // list boundArgs in the same order followed by the same
134
- // values as the list ExtraArgs in the same order.
135
- // 5. Return the result of calling the [[Construct]] internal
136
- // method of target providing args as the arguments.
137
-
138
- var result = target.apply(
139
- this,
140
- args.concat(array_slice.call(arguments))
141
- );
142
- if (Object(result) === result) {
143
- return result;
144
- }
145
- return this;
146
-
147
- } else {
148
- // 15.3.4.5.1 [[Call]]
149
- // When the [[Call]] internal method of a function object, F,
150
- // which was created using the bind function is called with a
151
- // this value and a list of arguments ExtraArgs, the following
152
- // steps are taken:
153
- // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
154
- // property.
155
- // 2. Let boundThis be the value of F's [[BoundThis]] internal
156
- // property.
157
- // 3. Let target be the value of F's [[TargetFunction]] internal
158
- // property.
159
- // 4. Let args be a new list containing the same values as the
160
- // list boundArgs in the same order followed by the same
161
- // values as the list ExtraArgs in the same order.
162
- // 5. Return the result of calling the [[Call]] internal method
163
- // of target providing boundThis as the this value and
164
- // providing args as the arguments.
165
-
166
- // equiv: target.call(this, ...boundArgs, ...args)
167
- return target.apply(
168
- that,
169
- args.concat(array_slice.call(arguments))
170
- );
171
-
172
- }
173
-
174
- };
175
-
176
- // 15. If the [[Class]] internal property of Target is "Function", then
177
- // a. Let L be the length property of Target minus the length of A.
178
- // b. Set the length own property of F to either 0 or L, whichever is
179
- // larger.
180
- // 16. Else set the length own property of F to 0.
181
-
182
- var boundLength = Math.max(0, target.length - args.length);
183
-
184
- // 17. Set the attributes of the length own property of F to the values
185
- // specified in 15.3.5.1.
186
- var boundArgs = [];
187
- for (var i = 0; i < boundLength; i++) {
188
- boundArgs.push('$' + i);
189
- }
190
-
191
- // XXX Build a dynamic function with desired amount of arguments is the only
192
- // way to set the length property of a function.
193
- // In environments where Content Security Policies enabled (Chrome extensions,
194
- // for ex.) all use of eval or Function costructor throws an exception.
195
- // However in all of these environments Function.prototype.bind exists
196
- // and so this code will never be executed.
197
- var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
198
-
199
- if (target.prototype) {
200
- Empty.prototype = target.prototype;
201
- bound.prototype = new Empty();
202
- // Clean up dangling references.
203
- Empty.prototype = null;
204
- }
205
-
206
- // TODO
207
- // 18. Set the [[Extensible]] internal property of F to true.
208
-
209
- // TODO
210
- // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
211
- // 20. Call the [[DefineOwnProperty]] internal method of F with
212
- // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
213
- // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
214
- // false.
215
- // 21. Call the [[DefineOwnProperty]] internal method of F with
216
- // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
217
- // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
218
- // and false.
219
-
220
- // TODO
221
- // NOTE Function objects created using Function.prototype.bind do not
222
- // have a prototype property or the [[Code]], [[FormalParameters]], and
223
- // [[Scope]] internal properties.
224
- // XXX can't delete prototype in pure-js.
225
-
226
- // 22. Return F.
227
- return bound;
228
- }
229
- });
230
-
231
- //
232
- // Array
233
- // =====
234
- //
235
-
236
- // ES5 15.4.3.2
237
- // http://es5.github.com/#x15.4.3.2
238
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
239
- defineProperties(Array, { isArray: isArray });
240
-
241
-
242
- var boxedString = Object('a');
243
- var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
244
-
245
- var properlyBoxesContext = function properlyBoxed(method) {
246
- // Check node 0.6.21 bug where third parameter is not boxed
247
- var properlyBoxesNonStrict = true;
248
- var properlyBoxesStrict = true;
249
- if (method) {
250
- method.call('foo', function (_, __, context) {
251
- if (typeof context !== 'object') { properlyBoxesNonStrict = false; }
252
- });
253
-
254
- method.call([1], function () {
255
- properlyBoxesStrict = typeof this === 'string';
256
- }, 'x');
257
- }
258
- return !!method && properlyBoxesNonStrict && properlyBoxesStrict;
259
- };
260
-
261
- defineProperties(ArrayPrototype, {
262
- forEach: function forEach(fun /*, thisp*/) {
263
- var object = toObject(this),
264
- self = splitString && isString(this) ? this.split('') : object,
265
- thisp = arguments[1],
266
- i = -1,
267
- length = self.length >>> 0;
268
-
269
- // If no callback function or if callback is not a callable function
270
- if (!isFunction(fun)) {
271
- throw new TypeError(); // TODO message
272
- }
273
-
274
- while (++i < length) {
275
- if (i in self) {
276
- // Invoke the callback function with call, passing arguments:
277
- // context, property value, property key, thisArg object
278
- // context
279
- fun.call(thisp, self[i], i, object);
280
- }
281
- }
282
- }
283
- }, !properlyBoxesContext(ArrayPrototype.forEach));
284
-
285
- // ES5 15.4.4.14
286
- // http://es5.github.com/#x15.4.4.14
287
- // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
288
- var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
289
- defineProperties(ArrayPrototype, {
290
- indexOf: function indexOf(sought /*, fromIndex */ ) {
291
- var self = splitString && isString(this) ? this.split('') : toObject(this),
292
- length = self.length >>> 0;
293
-
294
- if (!length) {
295
- return -1;
296
- }
297
-
298
- var i = 0;
299
- if (arguments.length > 1) {
300
- i = toInteger(arguments[1]);
301
- }
302
-
303
- // handle negative indices
304
- i = i >= 0 ? i : Math.max(0, length + i);
305
- for (; i < length; i++) {
306
- if (i in self && self[i] === sought) {
307
- return i;
308
- }
309
- }
310
- return -1;
311
- }
312
- }, hasFirefox2IndexOfBug);
313
-
314
- //
315
- // String
316
- // ======
317
- //
318
-
319
- // ES5 15.5.4.14
320
- // http://es5.github.com/#x15.5.4.14
321
-
322
- // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
323
- // Many browsers do not split properly with regular expressions or they
324
- // do not perform the split correctly under obscure conditions.
325
- // See http://blog.stevenlevithan.com/archives/cross-browser-split
326
- // I've tested in many browsers and this seems to cover the deviant ones:
327
- // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
328
- // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
329
- // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
330
- // [undefined, "t", undefined, "e", ...]
331
- // ''.split(/.?/) should be [], not [""]
332
- // '.'.split(/()()/) should be ["."], not ["", "", "."]
333
-
334
- var string_split = StringPrototype.split;
335
- if (
336
- 'ab'.split(/(?:ab)*/).length !== 2 ||
337
- '.'.split(/(.?)(.?)/).length !== 4 ||
338
- 'tesst'.split(/(s)*/)[1] === 't' ||
339
- 'test'.split(/(?:)/, -1).length !== 4 ||
340
- ''.split(/.?/).length ||
341
- '.'.split(/()()/).length > 1
342
- ) {
343
- (function () {
344
- var compliantExecNpcg = /()??/.exec('')[1] === void 0; // NPCG: nonparticipating capturing group
345
-
346
- StringPrototype.split = function (separator, limit) {
347
- var string = this;
348
- if (separator === void 0 && limit === 0) {
349
- return [];
350
- }
351
-
352
- // If `separator` is not a regex, use native split
353
- if (_toString.call(separator) !== '[object RegExp]') {
354
- return string_split.call(this, separator, limit);
355
- }
356
-
357
- var output = [],
358
- flags = (separator.ignoreCase ? 'i' : '') +
359
- (separator.multiline ? 'm' : '') +
360
- (separator.extended ? 'x' : '') + // Proposed for ES6
361
- (separator.sticky ? 'y' : ''), // Firefox 3+
362
- lastLastIndex = 0,
363
- // Make `global` and avoid `lastIndex` issues by working with a copy
364
- separator2, match, lastIndex, lastLength;
365
- separator = new RegExp(separator.source, flags + 'g');
366
- string += ''; // Type-convert
367
- if (!compliantExecNpcg) {
368
- // Doesn't need flags gy, but they don't hurt
369
- separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags);
370
- }
371
- /* Values for `limit`, per the spec:
372
- * If undefined: 4294967295 // Math.pow(2, 32) - 1
373
- * If 0, Infinity, or NaN: 0
374
- * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
375
- * If negative number: 4294967296 - Math.floor(Math.abs(limit))
376
- * If other: Type-convert, then use the above rules
377
- */
378
- limit = limit === void 0 ?
379
- -1 >>> 0 : // Math.pow(2, 32) - 1
380
- ToUint32(limit);
381
- while (match = separator.exec(string)) {
382
- // `separator.lastIndex` is not reliable cross-browser
383
- lastIndex = match.index + match[0].length;
384
- if (lastIndex > lastLastIndex) {
385
- output.push(string.slice(lastLastIndex, match.index));
386
- // Fix browsers whose `exec` methods don't consistently return `undefined` for
387
- // nonparticipating capturing groups
388
- if (!compliantExecNpcg && match.length > 1) {
389
- match[0].replace(separator2, function () {
390
- for (var i = 1; i < arguments.length - 2; i++) {
391
- if (arguments[i] === void 0) {
392
- match[i] = void 0;
393
- }
394
- }
395
- });
396
- }
397
- if (match.length > 1 && match.index < string.length) {
398
- ArrayPrototype.push.apply(output, match.slice(1));
399
- }
400
- lastLength = match[0].length;
401
- lastLastIndex = lastIndex;
402
- if (output.length >= limit) {
403
- break;
404
- }
405
- }
406
- if (separator.lastIndex === match.index) {
407
- separator.lastIndex++; // Avoid an infinite loop
408
- }
409
- }
410
- if (lastLastIndex === string.length) {
411
- if (lastLength || !separator.test('')) {
412
- output.push('');
413
- }
414
- } else {
415
- output.push(string.slice(lastLastIndex));
416
- }
417
- return output.length > limit ? output.slice(0, limit) : output;
418
- };
419
- }());
420
-
421
- // [bugfix, chrome]
422
- // If separator is undefined, then the result array contains just one String,
423
- // which is the this value (converted to a String). If limit is not undefined,
424
- // then the output array is truncated so that it contains no more than limit
425
- // elements.
426
- // "0".split(undefined, 0) -> []
427
- } else if ('0'.split(void 0, 0).length) {
428
- StringPrototype.split = function split(separator, limit) {
429
- if (separator === void 0 && limit === 0) { return []; }
430
- return string_split.call(this, separator, limit);
431
- };
432
- }
433
-
434
- // ECMA-262, 3rd B.2.3
435
- // Not an ECMAScript standard, although ECMAScript 3rd Edition has a
436
- // non-normative section suggesting uniform semantics and it should be
437
- // normalized across all browsers
438
- // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
439
- var string_substr = StringPrototype.substr;
440
- var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
441
- defineProperties(StringPrototype, {
442
- substr: function substr(start, length) {
443
- return string_substr.call(
444
- this,
445
- start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start,
446
- length
447
- );
448
- }
449
- }, hasNegativeSubstrBug);
@@ -1,5 +0,0 @@
1
- import websocket$1 from '../../../../faye-websocket/lib/faye/websocket.js';
2
-
3
- var websocket = websocket$1.Client;
4
-
5
- export { websocket as default };
@@ -1,80 +0,0 @@
1
- import require$$1 from 'events';
2
- import '../../../../inherits/inherits.js';
3
- import require$$3 from 'http';
4
- import require$$4 from 'https';
5
- import urlParse from '../../../../url-parse/index.js';
6
- import { __require as requireSrc } from '../../../../debug/src/index.js';
7
- import { exports as inheritsExports } from '../../../../../_virtual/inherits.js';
8
-
9
- var EventEmitter = require$$1.EventEmitter
10
- , inherits = inheritsExports
11
- , http = require$$3
12
- , https = require$$4
13
- , URL = urlParse
14
- ;
15
-
16
- var debug = function() {};
17
- if (process.env.NODE_ENV !== 'production') {
18
- debug = requireSrc()('sockjs-client:driver:xhr');
19
- }
20
-
21
- function XhrDriver(method, url, payload, opts) {
22
- debug(method, url, payload);
23
- var self = this;
24
- EventEmitter.call(this);
25
-
26
- var parsedUrl = new URL(url);
27
- var options = {
28
- method: method
29
- , hostname: parsedUrl.hostname.replace(/\[|\]/g, '')
30
- , port: parsedUrl.port
31
- , path: parsedUrl.pathname + (parsedUrl.query || '')
32
- , headers: opts && opts.headers
33
- , agent: false
34
- };
35
-
36
- var protocol = parsedUrl.protocol === 'https:' ? https : http;
37
- this.req = protocol.request(options, function(res) {
38
- res.setEncoding('utf8');
39
- var responseText = '';
40
-
41
- res.on('data', function(chunk) {
42
- debug('data', chunk);
43
- responseText += chunk;
44
- self.emit('chunk', 200, responseText);
45
- });
46
- res.once('end', function() {
47
- debug('end');
48
- self.emit('finish', res.statusCode, responseText);
49
- self.req = null;
50
- });
51
- });
52
-
53
- this.req.on('error', function(e) {
54
- debug('error', e);
55
- self.emit('finish', 0, e.message);
56
- });
57
-
58
- if (payload) {
59
- this.req.write(payload);
60
- }
61
- this.req.end();
62
- }
63
-
64
- inherits(XhrDriver, EventEmitter);
65
-
66
- XhrDriver.prototype.close = function() {
67
- debug('close');
68
- this.removeAllListeners();
69
- if (this.req) {
70
- this.req.abort();
71
- this.req = null;
72
- }
73
- };
74
-
75
- XhrDriver.enabled = true;
76
- XhrDriver.supportsCORS = true;
77
-
78
- var xhr = XhrDriver;
79
-
80
- export { xhr as default };
@@ -1,34 +0,0 @@
1
- import '../../../inherits/inherits.js';
2
- import ajaxBased from './lib/ajax-based.js';
3
- import eventsource$2 from './receiver/eventsource.js';
4
- import xhrCors from './sender/xhr-cors.js';
5
- import eventsource$1 from '../../../eventsource/lib/eventsource.js';
6
- import { exports as inheritsExports } from '../../../../_virtual/inherits.js';
7
-
8
- var inherits = inheritsExports
9
- , AjaxBasedTransport = ajaxBased
10
- , EventSourceReceiver = eventsource$2
11
- , XHRCorsObject = xhrCors
12
- , EventSourceDriver = eventsource$1
13
- ;
14
-
15
- function EventSourceTransport(transUrl) {
16
- if (!EventSourceTransport.enabled()) {
17
- throw new Error('Transport created when disabled');
18
- }
19
-
20
- AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);
21
- }
22
-
23
- inherits(EventSourceTransport, AjaxBasedTransport);
24
-
25
- EventSourceTransport.enabled = function() {
26
- return !!EventSourceDriver;
27
- };
28
-
29
- EventSourceTransport.transportName = 'eventsource';
30
- EventSourceTransport.roundTrips = 2;
31
-
32
- var eventsource = EventSourceTransport;
33
-
34
- export { eventsource as default };
@@ -1,31 +0,0 @@
1
- import '../../../inherits/inherits.js';
2
- import htmlfile$1 from './receiver/htmlfile.js';
3
- import xhrLocal from './sender/xhr-local.js';
4
- import ajaxBased from './lib/ajax-based.js';
5
- import { exports as inheritsExports } from '../../../../_virtual/inherits.js';
6
-
7
- var inherits = inheritsExports
8
- , HtmlfileReceiver = htmlfile$1
9
- , XHRLocalObject = xhrLocal
10
- , AjaxBasedTransport = ajaxBased
11
- ;
12
-
13
- function HtmlFileTransport(transUrl) {
14
- if (!HtmlfileReceiver.enabled) {
15
- throw new Error('Transport created when disabled');
16
- }
17
- AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);
18
- }
19
-
20
- inherits(HtmlFileTransport, AjaxBasedTransport);
21
-
22
- HtmlFileTransport.enabled = function(info) {
23
- return HtmlfileReceiver.enabled && info.sameOrigin;
24
- };
25
-
26
- HtmlFileTransport.transportName = 'htmlfile';
27
- HtmlFileTransport.roundTrips = 2;
28
-
29
- var htmlfile = HtmlFileTransport;
30
-
31
- export { htmlfile as default };