zmdms-utils 0.0.81 → 0.0.82

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 (160) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/package.json +2 -6
  4. package/src/index.ts +0 -3
  5. package/dist/es/_virtual/FastBufferList.js +0 -7
  6. package/dist/es/_virtual/_commonjs-dynamic-modules.js +0 -5
  7. package/dist/es/_virtual/browser.js +0 -7
  8. package/dist/es/_virtual/browser2.js +0 -7
  9. package/dist/es/_virtual/debug.js +0 -7
  10. package/dist/es/_virtual/event.js +0 -7
  11. package/dist/es/_virtual/http-parser.js +0 -3
  12. package/dist/es/_virtual/iframe.js +0 -7
  13. package/dist/es/_virtual/index.js +0 -7
  14. package/dist/es/_virtual/index2.js +0 -7
  15. package/dist/es/_virtual/index3.js +0 -7
  16. package/dist/es/_virtual/index4.js +0 -7
  17. package/dist/es/_virtual/index5.js +0 -7
  18. package/dist/es/_virtual/index6.js +0 -7
  19. package/dist/es/_virtual/index7.js +0 -3
  20. package/dist/es/_virtual/index8.js +0 -7
  21. package/dist/es/_virtual/index9.js +0 -7
  22. package/dist/es/_virtual/inherits.js +0 -7
  23. package/dist/es/_virtual/inherits_browser.js +0 -7
  24. package/dist/es/_virtual/json3.js +0 -7
  25. package/dist/es/_virtual/node.js +0 -7
  26. package/dist/es/_virtual/node2.js +0 -7
  27. package/dist/es/_virtual/stomp-node.js +0 -3
  28. package/dist/es/_virtual/stomp.js +0 -3
  29. package/dist/es/_virtual/streams.js +0 -3
  30. package/dist/es/_virtual/utils.js +0 -3
  31. package/dist/es/node_modules/bufferutil/fallback.js +0 -43
  32. package/dist/es/node_modules/bufferutil/index.js +0 -21
  33. package/dist/es/node_modules/debug/src/browser.js +0 -192
  34. package/dist/es/node_modules/debug/src/common.js +0 -259
  35. package/dist/es/node_modules/debug/src/index.js +0 -25
  36. package/dist/es/node_modules/debug/src/node.js +0 -192
  37. package/dist/es/node_modules/eventsource/lib/eventsource.js +0 -493
  38. package/dist/es/node_modules/faye-websocket/lib/faye/eventsource.js +0 -150
  39. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event.js +0 -31
  40. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js +0 -41
  41. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/api.js +0 -205
  42. package/dist/es/node_modules/faye-websocket/lib/faye/websocket/client.js +0 -107
  43. package/dist/es/node_modules/faye-websocket/lib/faye/websocket.js +0 -47
  44. package/dist/es/node_modules/has-flag/index.js +0 -17
  45. package/dist/es/node_modules/http-parser-js/http-parser.js +0 -471
  46. package/dist/es/node_modules/inherits/inherits.js +0 -14
  47. package/dist/es/node_modules/inherits/inherits_browser.js +0 -38
  48. package/dist/es/node_modules/is-typedarray/index.js +0 -51
  49. package/dist/es/node_modules/json3/lib/json3.js +0 -937
  50. package/dist/es/node_modules/ms/index.js +0 -172
  51. package/dist/es/node_modules/node-gyp-build/index.js +0 -21
  52. package/dist/es/node_modules/node-gyp-build/node-gyp-build.js +0 -222
  53. package/dist/es/node_modules/querystringify/index.js +0 -120
  54. package/dist/es/node_modules/requires-port/index.js +0 -38
  55. package/dist/es/node_modules/safe-buffer/index.js +0 -71
  56. package/dist/es/node_modules/supports-color/index.js +0 -143
  57. package/dist/es/node_modules/typedarray-to-buffer/index.js +0 -37
  58. package/dist/es/node_modules/url-parse/index.js +0 -594
  59. package/dist/es/node_modules/utf-8-validate/fallback.js +0 -71
  60. package/dist/es/node_modules/utf-8-validate/index.js +0 -21
  61. package/dist/es/node_modules/websocket/index.js +0 -15
  62. package/dist/es/node_modules/websocket/lib/Deprecation.js +0 -42
  63. package/dist/es/node_modules/websocket/lib/W3CWebSocket.js +0 -268
  64. package/dist/es/node_modules/websocket/lib/WebSocketClient.js +0 -380
  65. package/dist/es/node_modules/websocket/lib/WebSocketConnection.js +0 -914
  66. package/dist/es/node_modules/websocket/lib/WebSocketFrame.js +0 -293
  67. package/dist/es/node_modules/websocket/lib/WebSocketRequest.js +0 -543
  68. package/dist/es/node_modules/websocket/lib/WebSocketRouter.js +0 -172
  69. package/dist/es/node_modules/websocket/lib/WebSocketRouterRequest.js +0 -67
  70. package/dist/es/node_modules/websocket/lib/WebSocketServer.js +0 -272
  71. package/dist/es/node_modules/websocket/lib/utils.js +0 -80
  72. package/dist/es/node_modules/websocket/lib/version.js +0 -13
  73. package/dist/es/node_modules/websocket/lib/websocket.js +0 -31
  74. package/dist/es/node_modules/websocket/node_modules/debug/src/browser.js +0 -199
  75. package/dist/es/node_modules/websocket/node_modules/debug/src/debug.js +0 -215
  76. package/dist/es/node_modules/websocket/node_modules/debug/src/index.js +0 -25
  77. package/dist/es/node_modules/websocket/node_modules/debug/src/node.js +0 -266
  78. package/dist/es/node_modules/websocket/node_modules/ms/index.js +0 -162
  79. package/dist/es/node_modules/websocket/package.json.js +0 -77
  80. package/dist/es/node_modules/websocket/vendor/FastBufferList.js +0 -205
  81. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/base.js +0 -202
  82. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/client.js +0 -152
  83. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft75.js +0 -128
  84. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/draft76.js +0 -124
  85. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/headers.js +0 -44
  86. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/frame.js +0 -21
  87. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi/message.js +0 -37
  88. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/hybi.js +0 -492
  89. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/proxy.js +0 -108
  90. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/server.js +0 -119
  91. package/dist/es/node_modules/websocket-driver/lib/websocket/driver/stream_reader.js +0 -72
  92. package/dist/es/node_modules/websocket-driver/lib/websocket/driver.js +0 -47
  93. package/dist/es/node_modules/websocket-driver/lib/websocket/http_parser.js +0 -140
  94. package/dist/es/node_modules/websocket-driver/lib/websocket/streams.js +0 -150
  95. package/dist/es/node_modules/websocket-extensions/lib/parser.js +0 -103
  96. package/dist/es/node_modules/websocket-extensions/lib/pipeline/cell.js +0 -56
  97. package/dist/es/node_modules/websocket-extensions/lib/pipeline/functor.js +0 -74
  98. package/dist/es/node_modules/websocket-extensions/lib/pipeline/index.js +0 -50
  99. package/dist/es/node_modules/websocket-extensions/lib/pipeline/pledge.js +0 -39
  100. package/dist/es/node_modules/websocket-extensions/lib/pipeline/ring_buffer.js +0 -66
  101. package/dist/es/node_modules/websocket-extensions/lib/websocket_extensions.js +0 -165
  102. package/dist/es/node_modules/yaeti/index.js +0 -17
  103. package/dist/es/node_modules/yaeti/lib/Event.js +0 -24
  104. package/dist/es/node_modules/yaeti/lib/EventTarget.js +0 -130
  105. package/dist/es/node_modules/zt-sockjs-client/lib/entry.js +0 -14
  106. package/dist/es/node_modules/zt-sockjs-client/lib/event/close.js +0 -21
  107. package/dist/es/node_modules/zt-sockjs-client/lib/event/event.js +0 -22
  108. package/dist/es/node_modules/zt-sockjs-client/lib/event/eventtarget.js +0 -62
  109. package/dist/es/node_modules/zt-sockjs-client/lib/event/trans-message.js +0 -19
  110. package/dist/es/node_modules/zt-sockjs-client/lib/facade.js +0 -40
  111. package/dist/es/node_modules/zt-sockjs-client/lib/iframe-bootstrap.js +0 -122
  112. package/dist/es/node_modules/zt-sockjs-client/lib/info-ajax.js +0 -57
  113. package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe-receiver.js +0 -50
  114. package/dist/es/node_modules/zt-sockjs-client/lib/info-iframe.js +0 -81
  115. package/dist/es/node_modules/zt-sockjs-client/lib/info-receiver.js +0 -101
  116. package/dist/es/node_modules/zt-sockjs-client/lib/location.js +0 -12
  117. package/dist/es/node_modules/zt-sockjs-client/lib/main.js +0 -413
  118. package/dist/es/node_modules/zt-sockjs-client/lib/shims.js +0 -449
  119. package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/websocket.js +0 -5
  120. package/dist/es/node_modules/zt-sockjs-client/lib/transport/driver/xhr.js +0 -80
  121. package/dist/es/node_modules/zt-sockjs-client/lib/transport/eventsource.js +0 -34
  122. package/dist/es/node_modules/zt-sockjs-client/lib/transport/htmlfile.js +0 -31
  123. package/dist/es/node_modules/zt-sockjs-client/lib/transport/iframe.js +0 -154
  124. package/dist/es/node_modules/zt-sockjs-client/lib/transport/jsonp-polling.js +0 -41
  125. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/ajax-based.js +0 -55
  126. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/buffered-sender.js +0 -92
  127. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/iframe-wrap.js +0 -39
  128. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/polling.js +0 -65
  129. package/dist/es/node_modules/zt-sockjs-client/lib/transport/lib/sender-receiver.js +0 -52
  130. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/eventsource.js +0 -69
  131. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/htmlfile.js +0 -96
  132. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/jsonp.js +0 -193
  133. package/dist/es/node_modules/zt-sockjs-client/lib/transport/receiver/xhr.js +0 -75
  134. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/jsonp.js +0 -104
  135. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xdr.js +0 -113
  136. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-cors.js +0 -19
  137. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-fake.js +0 -28
  138. package/dist/es/node_modules/zt-sockjs-client/lib/transport/sender/xhr-local.js +0 -21
  139. package/dist/es/node_modules/zt-sockjs-client/lib/transport/websocket.js +0 -108
  140. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-polling.js +0 -30
  141. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xdr-streaming.js +0 -38
  142. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-polling.js +0 -40
  143. package/dist/es/node_modules/zt-sockjs-client/lib/transport/xhr-streaming.js +0 -50
  144. package/dist/es/node_modules/zt-sockjs-client/lib/transport-list.js +0 -28
  145. package/dist/es/node_modules/zt-sockjs-client/lib/utils/browser.js +0 -29
  146. package/dist/es/node_modules/zt-sockjs-client/lib/utils/escape.js +0 -53
  147. package/dist/es/node_modules/zt-sockjs-client/lib/utils/event.js +0 -78
  148. package/dist/es/node_modules/zt-sockjs-client/lib/utils/iframe.js +0 -205
  149. package/dist/es/node_modules/zt-sockjs-client/lib/utils/log.js +0 -20
  150. package/dist/es/node_modules/zt-sockjs-client/lib/utils/object.js +0 -24
  151. package/dist/es/node_modules/zt-sockjs-client/lib/utils/random.js +0 -30
  152. package/dist/es/node_modules/zt-sockjs-client/lib/utils/transport.js +0 -52
  153. package/dist/es/node_modules/zt-sockjs-client/lib/utils/url.js +0 -54
  154. package/dist/es/node_modules/zt-sockjs-client/lib/version.js +0 -11
  155. package/dist/es/node_modules/zt-stompjs/index.js +0 -23
  156. package/dist/es/node_modules/zt-stompjs/lib/stomp-node.js +0 -117
  157. package/dist/es/node_modules/zt-stompjs/lib/stomp.js +0 -536
  158. package/dist/es/stompClient.d.ts +0 -55
  159. package/dist/es/stompClient.js +0 -379
  160. package/src/stompClient.ts +0 -449
@@ -1,199 +0,0 @@
1
- import { exports as browserExports, __module as browser } from '../../../../../_virtual/browser.js';
2
- import { __require as requireDebug } from './debug.js';
3
-
4
- /**
5
- * This is the web browser implementation of `debug()`.
6
- *
7
- * Expose `debug()` as the module.
8
- */
9
-
10
- var hasRequiredBrowser;
11
-
12
- function requireBrowser () {
13
- if (hasRequiredBrowser) return browserExports;
14
- hasRequiredBrowser = 1;
15
- (function (module, exports) {
16
- exports = module.exports = requireDebug();
17
- exports.log = log;
18
- exports.formatArgs = formatArgs;
19
- exports.save = save;
20
- exports.load = load;
21
- exports.useColors = useColors;
22
- exports.storage = 'undefined' != typeof chrome
23
- && 'undefined' != typeof chrome.storage
24
- ? chrome.storage.local
25
- : localstorage();
26
-
27
- /**
28
- * Colors.
29
- */
30
-
31
- exports.colors = [
32
- 'lightseagreen',
33
- 'forestgreen',
34
- 'goldenrod',
35
- 'dodgerblue',
36
- 'darkorchid',
37
- 'crimson'
38
- ];
39
-
40
- /**
41
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
42
- * and the Firebug extension (any Firefox version) are known
43
- * to support "%c" CSS customizations.
44
- *
45
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
46
- */
47
-
48
- function useColors() {
49
- // NB: In an Electron preload script, document will be defined but not fully
50
- // initialized. Since we know we're in Chrome, we'll just detect this case
51
- // explicitly
52
- if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
53
- return true;
54
- }
55
-
56
- // is webkit? http://stackoverflow.com/a/16459606/376773
57
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
58
- return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
59
- // is firebug? http://stackoverflow.com/a/398120/376773
60
- (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
61
- // is firefox >= v31?
62
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
63
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
64
- // double check webkit in userAgent just in case we are in a worker
65
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
66
- }
67
-
68
- /**
69
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
70
- */
71
-
72
- exports.formatters.j = function(v) {
73
- try {
74
- return JSON.stringify(v);
75
- } catch (err) {
76
- return '[UnexpectedJSONParseError]: ' + err.message;
77
- }
78
- };
79
-
80
-
81
- /**
82
- * Colorize log arguments if enabled.
83
- *
84
- * @api public
85
- */
86
-
87
- function formatArgs(args) {
88
- var useColors = this.useColors;
89
-
90
- args[0] = (useColors ? '%c' : '')
91
- + this.namespace
92
- + (useColors ? ' %c' : ' ')
93
- + args[0]
94
- + (useColors ? '%c ' : ' ')
95
- + '+' + exports.humanize(this.diff);
96
-
97
- if (!useColors) return;
98
-
99
- var c = 'color: ' + this.color;
100
- args.splice(1, 0, c, 'color: inherit');
101
-
102
- // the final "%c" is somewhat tricky, because there could be other
103
- // arguments passed either before or after the %c, so we need to
104
- // figure out the correct index to insert the CSS into
105
- var index = 0;
106
- var lastC = 0;
107
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
108
- if ('%%' === match) return;
109
- index++;
110
- if ('%c' === match) {
111
- // we only are interested in the *last* %c
112
- // (the user may have provided their own)
113
- lastC = index;
114
- }
115
- });
116
-
117
- args.splice(lastC, 0, c);
118
- }
119
-
120
- /**
121
- * Invokes `console.log()` when available.
122
- * No-op when `console.log` is not a "function".
123
- *
124
- * @api public
125
- */
126
-
127
- function log() {
128
- // this hackery is required for IE8/9, where
129
- // the `console.log` function doesn't have 'apply'
130
- return 'object' === typeof console
131
- && console.log
132
- && Function.prototype.apply.call(console.log, console, arguments);
133
- }
134
-
135
- /**
136
- * Save `namespaces`.
137
- *
138
- * @param {String} namespaces
139
- * @api private
140
- */
141
-
142
- function save(namespaces) {
143
- try {
144
- if (null == namespaces) {
145
- exports.storage.removeItem('debug');
146
- } else {
147
- exports.storage.debug = namespaces;
148
- }
149
- } catch(e) {}
150
- }
151
-
152
- /**
153
- * Load `namespaces`.
154
- *
155
- * @return {String} returns the previously persisted debug modes
156
- * @api private
157
- */
158
-
159
- function load() {
160
- var r;
161
- try {
162
- r = exports.storage.debug;
163
- } catch(e) {}
164
-
165
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
166
- if (!r && typeof process !== 'undefined' && 'env' in process) {
167
- r = process.env.DEBUG;
168
- }
169
-
170
- return r;
171
- }
172
-
173
- /**
174
- * Enable namespaces listed in `localStorage.debug` initially.
175
- */
176
-
177
- exports.enable(load());
178
-
179
- /**
180
- * Localstorage attempts to return the localstorage.
181
- *
182
- * This is necessary because safari throws
183
- * when a user disables cookies/localstorage
184
- * and you attempt to access it.
185
- *
186
- * @return {LocalStorage}
187
- * @api private
188
- */
189
-
190
- function localstorage() {
191
- try {
192
- return window.localStorage;
193
- } catch (e) {}
194
- }
195
- } (browser, browserExports));
196
- return browserExports;
197
- }
198
-
199
- export { requireBrowser as __require };
@@ -1,215 +0,0 @@
1
- import { exports as debugExports, __module as debug } from '../../../../../_virtual/debug.js';
2
- import { __require as requireMs } from '../../ms/index.js';
3
-
4
- var hasRequiredDebug;
5
-
6
- function requireDebug () {
7
- if (hasRequiredDebug) return debugExports;
8
- hasRequiredDebug = 1;
9
- (function (module, exports) {
10
- /**
11
- * This is the common logic for both the Node.js and web browser
12
- * implementations of `debug()`.
13
- *
14
- * Expose `debug()` as the module.
15
- */
16
-
17
- exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
18
- exports.coerce = coerce;
19
- exports.disable = disable;
20
- exports.enable = enable;
21
- exports.enabled = enabled;
22
- exports.humanize = requireMs();
23
-
24
- /**
25
- * The currently active debug mode names, and names to skip.
26
- */
27
-
28
- exports.names = [];
29
- exports.skips = [];
30
-
31
- /**
32
- * Map of special "%n" handling functions, for the debug "format" argument.
33
- *
34
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
35
- */
36
-
37
- exports.formatters = {};
38
-
39
- /**
40
- * Previous log timestamp.
41
- */
42
-
43
- var prevTime;
44
-
45
- /**
46
- * Select a color.
47
- * @param {String} namespace
48
- * @return {Number}
49
- * @api private
50
- */
51
-
52
- function selectColor(namespace) {
53
- var hash = 0, i;
54
-
55
- for (i in namespace) {
56
- hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
57
- hash |= 0; // Convert to 32bit integer
58
- }
59
-
60
- return exports.colors[Math.abs(hash) % exports.colors.length];
61
- }
62
-
63
- /**
64
- * Create a debugger with the given `namespace`.
65
- *
66
- * @param {String} namespace
67
- * @return {Function}
68
- * @api public
69
- */
70
-
71
- function createDebug(namespace) {
72
-
73
- function debug() {
74
- // disabled?
75
- if (!debug.enabled) return;
76
-
77
- var self = debug;
78
-
79
- // set `diff` timestamp
80
- var curr = +new Date();
81
- var ms = curr - (prevTime || curr);
82
- self.diff = ms;
83
- self.prev = prevTime;
84
- self.curr = curr;
85
- prevTime = curr;
86
-
87
- // turn the `arguments` into a proper Array
88
- var args = new Array(arguments.length);
89
- for (var i = 0; i < args.length; i++) {
90
- args[i] = arguments[i];
91
- }
92
-
93
- args[0] = exports.coerce(args[0]);
94
-
95
- if ('string' !== typeof args[0]) {
96
- // anything else let's inspect with %O
97
- args.unshift('%O');
98
- }
99
-
100
- // apply any `formatters` transformations
101
- var index = 0;
102
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
103
- // if we encounter an escaped % then don't increase the array index
104
- if (match === '%%') return match;
105
- index++;
106
- var formatter = exports.formatters[format];
107
- if ('function' === typeof formatter) {
108
- var val = args[index];
109
- match = formatter.call(self, val);
110
-
111
- // now we need to remove `args[index]` since it's inlined in the `format`
112
- args.splice(index, 1);
113
- index--;
114
- }
115
- return match;
116
- });
117
-
118
- // apply env-specific formatting (colors, etc.)
119
- exports.formatArgs.call(self, args);
120
-
121
- var logFn = debug.log || exports.log || console.log.bind(console);
122
- logFn.apply(self, args);
123
- }
124
-
125
- debug.namespace = namespace;
126
- debug.enabled = exports.enabled(namespace);
127
- debug.useColors = exports.useColors();
128
- debug.color = selectColor(namespace);
129
-
130
- // env-specific initialization logic for debug instances
131
- if ('function' === typeof exports.init) {
132
- exports.init(debug);
133
- }
134
-
135
- return debug;
136
- }
137
-
138
- /**
139
- * Enables a debug mode by namespaces. This can include modes
140
- * separated by a colon and wildcards.
141
- *
142
- * @param {String} namespaces
143
- * @api public
144
- */
145
-
146
- function enable(namespaces) {
147
- exports.save(namespaces);
148
-
149
- exports.names = [];
150
- exports.skips = [];
151
-
152
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
153
- var len = split.length;
154
-
155
- for (var i = 0; i < len; i++) {
156
- if (!split[i]) continue; // ignore empty strings
157
- namespaces = split[i].replace(/\*/g, '.*?');
158
- if (namespaces[0] === '-') {
159
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
160
- } else {
161
- exports.names.push(new RegExp('^' + namespaces + '$'));
162
- }
163
- }
164
- }
165
-
166
- /**
167
- * Disable debug output.
168
- *
169
- * @api public
170
- */
171
-
172
- function disable() {
173
- exports.enable('');
174
- }
175
-
176
- /**
177
- * Returns true if the given mode name is enabled, false otherwise.
178
- *
179
- * @param {String} name
180
- * @return {Boolean}
181
- * @api public
182
- */
183
-
184
- function enabled(name) {
185
- var i, len;
186
- for (i = 0, len = exports.skips.length; i < len; i++) {
187
- if (exports.skips[i].test(name)) {
188
- return false;
189
- }
190
- }
191
- for (i = 0, len = exports.names.length; i < len; i++) {
192
- if (exports.names[i].test(name)) {
193
- return true;
194
- }
195
- }
196
- return false;
197
- }
198
-
199
- /**
200
- * Coerce `val`.
201
- *
202
- * @param {Mixed} val
203
- * @return {Mixed}
204
- * @api private
205
- */
206
-
207
- function coerce(val) {
208
- if (val instanceof Error) return val.stack || val.message;
209
- return val;
210
- }
211
- } (debug, debugExports));
212
- return debugExports;
213
- }
214
-
215
- export { requireDebug as __require };
@@ -1,25 +0,0 @@
1
- import { exports as srcExports, __module as src } from '../../../../../_virtual/index3.js';
2
- import { __require as requireBrowser } from './browser.js';
3
- import { __require as requireNode } from './node.js';
4
-
5
- /**
6
- * Detect Electron renderer process, which is node, but we should
7
- * treat as a browser.
8
- */
9
-
10
- var hasRequiredSrc;
11
-
12
- function requireSrc () {
13
- if (hasRequiredSrc) return srcExports;
14
- hasRequiredSrc = 1;
15
- (function (module) {
16
- if (typeof process !== 'undefined' && process.type === 'renderer') {
17
- module.exports = requireBrowser();
18
- } else {
19
- module.exports = requireNode();
20
- }
21
- } (src));
22
- return srcExports;
23
- }
24
-
25
- export { requireSrc as __require };
@@ -1,266 +0,0 @@
1
- import { exports as nodeExports, __module as node } from '../../../../../_virtual/node.js';
2
- import require$$0 from 'tty';
3
- import require$$1 from 'util';
4
- import { __require as requireDebug } from './debug.js';
5
- import require$$3 from 'fs';
6
- import require$$1$1 from 'net';
7
-
8
- /**
9
- * Module dependencies.
10
- */
11
-
12
- var hasRequiredNode;
13
-
14
- function requireNode () {
15
- if (hasRequiredNode) return nodeExports;
16
- hasRequiredNode = 1;
17
- (function (module, exports) {
18
- var tty = require$$0;
19
- var util = require$$1;
20
-
21
- /**
22
- * This is the Node.js implementation of `debug()`.
23
- *
24
- * Expose `debug()` as the module.
25
- */
26
-
27
- exports = module.exports = requireDebug();
28
- exports.init = init;
29
- exports.log = log;
30
- exports.formatArgs = formatArgs;
31
- exports.save = save;
32
- exports.load = load;
33
- exports.useColors = useColors;
34
-
35
- /**
36
- * Colors.
37
- */
38
-
39
- exports.colors = [6, 2, 3, 4, 5, 1];
40
-
41
- /**
42
- * Build up the default `inspectOpts` object from the environment variables.
43
- *
44
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
45
- */
46
-
47
- exports.inspectOpts = Object.keys(process.env).filter(function (key) {
48
- return /^debug_/i.test(key);
49
- }).reduce(function (obj, key) {
50
- // camel-case
51
- var prop = key
52
- .substring(6)
53
- .toLowerCase()
54
- .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
55
-
56
- // coerce string value into JS value
57
- var val = process.env[key];
58
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
59
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
60
- else if (val === 'null') val = null;
61
- else val = Number(val);
62
-
63
- obj[prop] = val;
64
- return obj;
65
- }, {});
66
-
67
- /**
68
- * The file descriptor to write the `debug()` calls to.
69
- * Set the `DEBUG_FD` env variable to override with another value. i.e.:
70
- *
71
- * $ DEBUG_FD=3 node script.js 3>debug.log
72
- */
73
-
74
- var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
75
-
76
- if (1 !== fd && 2 !== fd) {
77
- util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')();
78
- }
79
-
80
- var stream = 1 === fd ? process.stdout :
81
- 2 === fd ? process.stderr :
82
- createWritableStdioStream(fd);
83
-
84
- /**
85
- * Is stdout a TTY? Colored output is enabled when `true`.
86
- */
87
-
88
- function useColors() {
89
- return 'colors' in exports.inspectOpts
90
- ? Boolean(exports.inspectOpts.colors)
91
- : tty.isatty(fd);
92
- }
93
-
94
- /**
95
- * Map %o to `util.inspect()`, all on a single line.
96
- */
97
-
98
- exports.formatters.o = function(v) {
99
- this.inspectOpts.colors = this.useColors;
100
- return util.inspect(v, this.inspectOpts)
101
- .split('\n').map(function(str) {
102
- return str.trim()
103
- }).join(' ');
104
- };
105
-
106
- /**
107
- * Map %o to `util.inspect()`, allowing multiple lines if needed.
108
- */
109
-
110
- exports.formatters.O = function(v) {
111
- this.inspectOpts.colors = this.useColors;
112
- return util.inspect(v, this.inspectOpts);
113
- };
114
-
115
- /**
116
- * Adds ANSI color escape codes if enabled.
117
- *
118
- * @api public
119
- */
120
-
121
- function formatArgs(args) {
122
- var name = this.namespace;
123
- var useColors = this.useColors;
124
-
125
- if (useColors) {
126
- var c = this.color;
127
- var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
128
-
129
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
130
- args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
131
- } else {
132
- args[0] = new Date().toUTCString()
133
- + ' ' + name + ' ' + args[0];
134
- }
135
- }
136
-
137
- /**
138
- * Invokes `util.format()` with the specified arguments and writes to `stream`.
139
- */
140
-
141
- function log() {
142
- return stream.write(util.format.apply(util, arguments) + '\n');
143
- }
144
-
145
- /**
146
- * Save `namespaces`.
147
- *
148
- * @param {String} namespaces
149
- * @api private
150
- */
151
-
152
- function save(namespaces) {
153
- if (null == namespaces) {
154
- // If you set a process.env field to null or undefined, it gets cast to the
155
- // string 'null' or 'undefined'. Just delete instead.
156
- delete process.env.DEBUG;
157
- } else {
158
- process.env.DEBUG = namespaces;
159
- }
160
- }
161
-
162
- /**
163
- * Load `namespaces`.
164
- *
165
- * @return {String} returns the previously persisted debug modes
166
- * @api private
167
- */
168
-
169
- function load() {
170
- return process.env.DEBUG;
171
- }
172
-
173
- /**
174
- * Copied from `node/src/node.js`.
175
- *
176
- * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
177
- * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
178
- */
179
-
180
- function createWritableStdioStream (fd) {
181
- var stream;
182
- var tty_wrap = process.binding('tty_wrap');
183
-
184
- // Note stream._type is used for test-module-load-list.js
185
-
186
- switch (tty_wrap.guessHandleType(fd)) {
187
- case 'TTY':
188
- stream = new tty.WriteStream(fd);
189
- stream._type = 'tty';
190
-
191
- // Hack to have stream not keep the event loop alive.
192
- // See https://github.com/joyent/node/issues/1726
193
- if (stream._handle && stream._handle.unref) {
194
- stream._handle.unref();
195
- }
196
- break;
197
-
198
- case 'FILE':
199
- var fs = require$$3;
200
- stream = new fs.SyncWriteStream(fd, { autoClose: false });
201
- stream._type = 'fs';
202
- break;
203
-
204
- case 'PIPE':
205
- case 'TCP':
206
- var net = require$$1$1;
207
- stream = new net.Socket({
208
- fd: fd,
209
- readable: false,
210
- writable: true
211
- });
212
-
213
- // FIXME Should probably have an option in net.Socket to create a
214
- // stream from an existing fd which is writable only. But for now
215
- // we'll just add this hack and set the `readable` member to false.
216
- // Test: ./node test/fixtures/echo.js < /etc/passwd
217
- stream.readable = false;
218
- stream.read = null;
219
- stream._type = 'pipe';
220
-
221
- // FIXME Hack to have stream not keep the event loop alive.
222
- // See https://github.com/joyent/node/issues/1726
223
- if (stream._handle && stream._handle.unref) {
224
- stream._handle.unref();
225
- }
226
- break;
227
-
228
- default:
229
- // Probably an error on in uv_guess_handle()
230
- throw new Error('Implement me. Unknown stream file type!');
231
- }
232
-
233
- // For supporting legacy API we put the FD here.
234
- stream.fd = fd;
235
-
236
- stream._isStdio = true;
237
-
238
- return stream;
239
- }
240
-
241
- /**
242
- * Init logic for `debug` instances.
243
- *
244
- * Create a new `inspectOpts` object in case `useColors` is set
245
- * differently for a particular `debug` instance.
246
- */
247
-
248
- function init (debug) {
249
- debug.inspectOpts = {};
250
-
251
- var keys = Object.keys(exports.inspectOpts);
252
- for (var i = 0; i < keys.length; i++) {
253
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
254
- }
255
- }
256
-
257
- /**
258
- * Enable namespaces listed in `process.env.DEBUG` initially.
259
- */
260
-
261
- exports.enable(load());
262
- } (node, nodeExports));
263
- return nodeExports;
264
- }
265
-
266
- export { requireNode as __require };