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,21 +0,0 @@
1
- import { exports as bufferutilExports, __module as bufferutil } from '../../_virtual/index4.js';
2
- import { __require as requireNodeGypBuild } from '../node-gyp-build/index.js';
3
- import { __require as requireFallback } from './fallback.js';
4
-
5
- var hasRequiredBufferutil;
6
-
7
- function requireBufferutil () {
8
- if (hasRequiredBufferutil) return bufferutilExports;
9
- hasRequiredBufferutil = 1;
10
- (function (module) {
11
-
12
- try {
13
- module.exports = requireNodeGypBuild()(__dirname);
14
- } catch (e) {
15
- module.exports = requireFallback();
16
- }
17
- } (bufferutil));
18
- return bufferutilExports;
19
- }
20
-
21
- export { requireBufferutil as __require };
@@ -1,192 +0,0 @@
1
- import { exports as browserExports, __module as browser } from '../../../_virtual/browser2.js';
2
- import { __require as requireCommon } from './common.js';
3
-
4
- var hasRequiredBrowser;
5
-
6
- function requireBrowser () {
7
- if (hasRequiredBrowser) return browserExports;
8
- hasRequiredBrowser = 1;
9
- (function (module, exports) {
10
-
11
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12
-
13
- /* eslint-env browser */
14
-
15
- /**
16
- * This is the web browser implementation of `debug()`.
17
- */
18
- exports.log = log;
19
- exports.formatArgs = formatArgs;
20
- exports.save = save;
21
- exports.load = load;
22
- exports.useColors = useColors;
23
- exports.storage = localstorage();
24
- /**
25
- * Colors.
26
- */
27
-
28
- exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
29
- /**
30
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
31
- * and the Firebug extension (any Firefox version) are known
32
- * to support "%c" CSS customizations.
33
- *
34
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
35
- */
36
- // eslint-disable-next-line complexity
37
-
38
- function useColors() {
39
- // NB: In an Electron preload script, document will be defined but not fully
40
- // initialized. Since we know we're in Chrome, we'll just detect this case
41
- // explicitly
42
- if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
43
- return true;
44
- } // Internet Explorer and Edge do not support colors.
45
-
46
-
47
- if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
48
- return false;
49
- } // Is webkit? http://stackoverflow.com/a/16459606/376773
50
- // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
51
-
52
-
53
- return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
54
- typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
55
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
56
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
57
- typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
58
- }
59
- /**
60
- * Colorize log arguments if enabled.
61
- *
62
- * @api public
63
- */
64
-
65
-
66
- function formatArgs(args) {
67
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
68
-
69
- if (!this.useColors) {
70
- return;
71
- }
72
-
73
- var c = 'color: ' + this.color;
74
- args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
75
- // arguments passed either before or after the %c, so we need to
76
- // figure out the correct index to insert the CSS into
77
-
78
- var index = 0;
79
- var lastC = 0;
80
- args[0].replace(/%[a-zA-Z%]/g, function (match) {
81
- if (match === '%%') {
82
- return;
83
- }
84
-
85
- index++;
86
-
87
- if (match === '%c') {
88
- // We only are interested in the *last* %c
89
- // (the user may have provided their own)
90
- lastC = index;
91
- }
92
- });
93
- args.splice(lastC, 0, c);
94
- }
95
- /**
96
- * Invokes `console.log()` when available.
97
- * No-op when `console.log` is not a "function".
98
- *
99
- * @api public
100
- */
101
-
102
-
103
- function log() {
104
- var _console;
105
-
106
- // This hackery is required for IE8/9, where
107
- // the `console.log` function doesn't have 'apply'
108
- return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
109
- }
110
- /**
111
- * Save `namespaces`.
112
- *
113
- * @param {String} namespaces
114
- * @api private
115
- */
116
-
117
-
118
- function save(namespaces) {
119
- try {
120
- if (namespaces) {
121
- exports.storage.setItem('debug', namespaces);
122
- } else {
123
- exports.storage.removeItem('debug');
124
- }
125
- } catch (error) {// Swallow
126
- // XXX (@Qix-) should we be logging these?
127
- }
128
- }
129
- /**
130
- * Load `namespaces`.
131
- *
132
- * @return {String} returns the previously persisted debug modes
133
- * @api private
134
- */
135
-
136
-
137
- function load() {
138
- var r;
139
-
140
- try {
141
- r = exports.storage.getItem('debug');
142
- } catch (error) {} // Swallow
143
- // XXX (@Qix-) should we be logging these?
144
- // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
145
-
146
-
147
- if (!r && typeof process !== 'undefined' && 'env' in process) {
148
- r = process.env.DEBUG;
149
- }
150
-
151
- return r;
152
- }
153
- /**
154
- * Localstorage attempts to return the localstorage.
155
- *
156
- * This is necessary because safari throws
157
- * when a user disables cookies/localstorage
158
- * and you attempt to access it.
159
- *
160
- * @return {LocalStorage}
161
- * @api private
162
- */
163
-
164
-
165
- function localstorage() {
166
- try {
167
- // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
168
- // The Browser also has localStorage in the global context.
169
- return localStorage;
170
- } catch (error) {// Swallow
171
- // XXX (@Qix-) should we be logging these?
172
- }
173
- }
174
-
175
- module.exports = requireCommon()(exports);
176
- var formatters = module.exports.formatters;
177
- /**
178
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
179
- */
180
-
181
- formatters.j = function (v) {
182
- try {
183
- return JSON.stringify(v);
184
- } catch (error) {
185
- return '[UnexpectedJSONParseError]: ' + error.message;
186
- }
187
- };
188
- } (browser, browserExports));
189
- return browserExports;
190
- }
191
-
192
- export { requireBrowser as __require };
@@ -1,259 +0,0 @@
1
- import { __require as requireMs } from '../../ms/index.js';
2
-
3
- var common;
4
- var hasRequiredCommon;
5
-
6
- function requireCommon () {
7
- if (hasRequiredCommon) return common;
8
- hasRequiredCommon = 1;
9
-
10
- /**
11
- * This is the common logic for both the Node.js and web browser
12
- * implementations of `debug()`.
13
- */
14
- function setup(env) {
15
- createDebug.debug = createDebug;
16
- createDebug.default = createDebug;
17
- createDebug.coerce = coerce;
18
- createDebug.disable = disable;
19
- createDebug.enable = enable;
20
- createDebug.enabled = enabled;
21
- createDebug.humanize = requireMs();
22
- Object.keys(env).forEach(function (key) {
23
- createDebug[key] = env[key];
24
- });
25
- /**
26
- * Active `debug` instances.
27
- */
28
-
29
- createDebug.instances = [];
30
- /**
31
- * The currently active debug mode names, and names to skip.
32
- */
33
-
34
- createDebug.names = [];
35
- createDebug.skips = [];
36
- /**
37
- * Map of special "%n" handling functions, for the debug "format" argument.
38
- *
39
- * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
40
- */
41
-
42
- createDebug.formatters = {};
43
- /**
44
- * Selects a color for a debug namespace
45
- * @param {String} namespace The namespace string for the for the debug instance to be colored
46
- * @return {Number|String} An ANSI color code for the given namespace
47
- * @api private
48
- */
49
-
50
- function selectColor(namespace) {
51
- var hash = 0;
52
-
53
- for (var i = 0; i < namespace.length; i++) {
54
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
55
- hash |= 0; // Convert to 32bit integer
56
- }
57
-
58
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
59
- }
60
-
61
- createDebug.selectColor = selectColor;
62
- /**
63
- * Create a debugger with the given `namespace`.
64
- *
65
- * @param {String} namespace
66
- * @return {Function}
67
- * @api public
68
- */
69
-
70
- function createDebug(namespace) {
71
- var prevTime;
72
-
73
- function debug() {
74
- // Disabled?
75
- if (!debug.enabled) {
76
- return;
77
- }
78
-
79
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
- args[_key] = arguments[_key];
81
- }
82
-
83
- var self = debug; // Set `diff` timestamp
84
-
85
- var curr = Number(new Date());
86
- var ms = curr - (prevTime || curr);
87
- self.diff = ms;
88
- self.prev = prevTime;
89
- self.curr = curr;
90
- prevTime = curr;
91
- args[0] = createDebug.coerce(args[0]);
92
-
93
- if (typeof args[0] !== 'string') {
94
- // Anything else let's inspect with %O
95
- args.unshift('%O');
96
- } // Apply any `formatters` transformations
97
-
98
-
99
- var index = 0;
100
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
101
- // If we encounter an escaped % then don't increase the array index
102
- if (match === '%%') {
103
- return match;
104
- }
105
-
106
- index++;
107
- var formatter = createDebug.formatters[format];
108
-
109
- if (typeof formatter === 'function') {
110
- var val = args[index];
111
- match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
112
-
113
- args.splice(index, 1);
114
- index--;
115
- }
116
-
117
- return match;
118
- }); // Apply env-specific formatting (colors, etc.)
119
-
120
- createDebug.formatArgs.call(self, args);
121
- var logFn = self.log || createDebug.log;
122
- logFn.apply(self, args);
123
- }
124
-
125
- debug.namespace = namespace;
126
- debug.enabled = createDebug.enabled(namespace);
127
- debug.useColors = createDebug.useColors();
128
- debug.color = selectColor(namespace);
129
- debug.destroy = destroy;
130
- debug.extend = extend; // Debug.formatArgs = formatArgs;
131
- // debug.rawLog = rawLog;
132
- // env-specific initialization logic for debug instances
133
-
134
- if (typeof createDebug.init === 'function') {
135
- createDebug.init(debug);
136
- }
137
-
138
- createDebug.instances.push(debug);
139
- return debug;
140
- }
141
-
142
- function destroy() {
143
- var index = createDebug.instances.indexOf(this);
144
-
145
- if (index !== -1) {
146
- createDebug.instances.splice(index, 1);
147
- return true;
148
- }
149
-
150
- return false;
151
- }
152
-
153
- function extend(namespace, delimiter) {
154
- return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
155
- }
156
- /**
157
- * Enables a debug mode by namespaces. This can include modes
158
- * separated by a colon and wildcards.
159
- *
160
- * @param {String} namespaces
161
- * @api public
162
- */
163
-
164
-
165
- function enable(namespaces) {
166
- createDebug.save(namespaces);
167
- createDebug.names = [];
168
- createDebug.skips = [];
169
- var i;
170
- var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
171
- var len = split.length;
172
-
173
- for (i = 0; i < len; i++) {
174
- if (!split[i]) {
175
- // ignore empty strings
176
- continue;
177
- }
178
-
179
- namespaces = split[i].replace(/\*/g, '.*?');
180
-
181
- if (namespaces[0] === '-') {
182
- createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
183
- } else {
184
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
185
- }
186
- }
187
-
188
- for (i = 0; i < createDebug.instances.length; i++) {
189
- var instance = createDebug.instances[i];
190
- instance.enabled = createDebug.enabled(instance.namespace);
191
- }
192
- }
193
- /**
194
- * Disable debug output.
195
- *
196
- * @api public
197
- */
198
-
199
-
200
- function disable() {
201
- createDebug.enable('');
202
- }
203
- /**
204
- * Returns true if the given mode name is enabled, false otherwise.
205
- *
206
- * @param {String} name
207
- * @return {Boolean}
208
- * @api public
209
- */
210
-
211
-
212
- function enabled(name) {
213
- if (name[name.length - 1] === '*') {
214
- return true;
215
- }
216
-
217
- var i;
218
- var len;
219
-
220
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
221
- if (createDebug.skips[i].test(name)) {
222
- return false;
223
- }
224
- }
225
-
226
- for (i = 0, len = createDebug.names.length; i < len; i++) {
227
- if (createDebug.names[i].test(name)) {
228
- return true;
229
- }
230
- }
231
-
232
- return false;
233
- }
234
- /**
235
- * Coerce `val`.
236
- *
237
- * @param {Mixed} val
238
- * @return {Mixed}
239
- * @api private
240
- */
241
-
242
-
243
- function coerce(val) {
244
- if (val instanceof Error) {
245
- return val.stack || val.message;
246
- }
247
-
248
- return val;
249
- }
250
-
251
- createDebug.enable(createDebug.load());
252
- return createDebug;
253
- }
254
-
255
- common = setup;
256
- return common;
257
- }
258
-
259
- export { requireCommon as __require };
@@ -1,25 +0,0 @@
1
- import { exports as srcExports, __module as src } from '../../../_virtual/index8.js';
2
- import { __require as requireBrowser } from './browser.js';
3
- import { __require as requireNode } from './node.js';
4
-
5
- var hasRequiredSrc;
6
-
7
- function requireSrc () {
8
- if (hasRequiredSrc) return srcExports;
9
- hasRequiredSrc = 1;
10
- (function (module) {
11
-
12
- /**
13
- * Detect Electron renderer / nwjs process, which is node, but we should
14
- * treat as a browser.
15
- */
16
- if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
17
- module.exports = requireBrowser();
18
- } else {
19
- module.exports = requireNode();
20
- }
21
- } (src));
22
- return srcExports;
23
- }
24
-
25
- export { requireSrc as __require };
@@ -1,192 +0,0 @@
1
- import { exports as nodeExports, __module as node } from '../../../_virtual/node2.js';
2
- import require$$0 from 'tty';
3
- import require$$1 from 'util';
4
- import { __require as requireSupportsColor } from '../../supports-color/index.js';
5
- import { __require as requireCommon } from './common.js';
6
-
7
- var hasRequiredNode;
8
-
9
- function requireNode () {
10
- if (hasRequiredNode) return nodeExports;
11
- hasRequiredNode = 1;
12
- (function (module, exports) {
13
-
14
- /**
15
- * Module dependencies.
16
- */
17
- var tty = require$$0;
18
-
19
- var util = require$$1;
20
- /**
21
- * This is the Node.js implementation of `debug()`.
22
- */
23
-
24
-
25
- exports.init = init;
26
- exports.log = log;
27
- exports.formatArgs = formatArgs;
28
- exports.save = save;
29
- exports.load = load;
30
- exports.useColors = useColors;
31
- /**
32
- * Colors.
33
- */
34
-
35
- exports.colors = [6, 2, 3, 4, 5, 1];
36
-
37
- try {
38
- // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
39
- // eslint-disable-next-line import/no-extraneous-dependencies
40
- var supportsColor = requireSupportsColor();
41
-
42
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
43
- exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];
44
- }
45
- } catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.
46
-
47
- /**
48
- * Build up the default `inspectOpts` object from the environment variables.
49
- *
50
- * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
51
- */
52
-
53
-
54
- exports.inspectOpts = Object.keys(process.env).filter(function (key) {
55
- return /^debug_/i.test(key);
56
- }).reduce(function (obj, key) {
57
- // Camel-case
58
- var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {
59
- return k.toUpperCase();
60
- }); // Coerce string value into JS value
61
-
62
- var val = process.env[key];
63
-
64
- if (/^(yes|on|true|enabled)$/i.test(val)) {
65
- val = true;
66
- } else if (/^(no|off|false|disabled)$/i.test(val)) {
67
- val = false;
68
- } else if (val === 'null') {
69
- val = null;
70
- } else {
71
- val = Number(val);
72
- }
73
-
74
- obj[prop] = val;
75
- return obj;
76
- }, {});
77
- /**
78
- * Is stdout a TTY? Colored output is enabled when `true`.
79
- */
80
-
81
- function useColors() {
82
- return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
83
- }
84
- /**
85
- * Adds ANSI color escape codes if enabled.
86
- *
87
- * @api public
88
- */
89
-
90
-
91
- function formatArgs(args) {
92
- var name = this.namespace,
93
- useColors = this.useColors;
94
-
95
- if (useColors) {
96
- var c = this.color;
97
- var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c);
98
- var prefix = " ".concat(colorCode, ";1m").concat(name, " \x1B[0m");
99
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
100
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m");
101
- } else {
102
- args[0] = getDate() + name + ' ' + args[0];
103
- }
104
- }
105
-
106
- function getDate() {
107
- if (exports.inspectOpts.hideDate) {
108
- return '';
109
- }
110
-
111
- return new Date().toISOString() + ' ';
112
- }
113
- /**
114
- * Invokes `util.format()` with the specified arguments and writes to stderr.
115
- */
116
-
117
-
118
- function log() {
119
- return process.stderr.write(util.format.apply(util, arguments) + '\n');
120
- }
121
- /**
122
- * Save `namespaces`.
123
- *
124
- * @param {String} namespaces
125
- * @api private
126
- */
127
-
128
-
129
- function save(namespaces) {
130
- if (namespaces) {
131
- process.env.DEBUG = namespaces;
132
- } else {
133
- // If you set a process.env field to null or undefined, it gets cast to the
134
- // string 'null' or 'undefined'. Just delete instead.
135
- delete process.env.DEBUG;
136
- }
137
- }
138
- /**
139
- * Load `namespaces`.
140
- *
141
- * @return {String} returns the previously persisted debug modes
142
- * @api private
143
- */
144
-
145
-
146
- function load() {
147
- return process.env.DEBUG;
148
- }
149
- /**
150
- * Init logic for `debug` instances.
151
- *
152
- * Create a new `inspectOpts` object in case `useColors` is set
153
- * differently for a particular `debug` instance.
154
- */
155
-
156
-
157
- function init(debug) {
158
- debug.inspectOpts = {};
159
- var keys = Object.keys(exports.inspectOpts);
160
-
161
- for (var i = 0; i < keys.length; i++) {
162
- debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
163
- }
164
- }
165
-
166
- module.exports = requireCommon()(exports);
167
- var formatters = module.exports.formatters;
168
- /**
169
- * Map %o to `util.inspect()`, all on a single line.
170
- */
171
-
172
- formatters.o = function (v) {
173
- this.inspectOpts.colors = this.useColors;
174
- return util.inspect(v, this.inspectOpts)
175
- .split('\n')
176
- .map(function (str) { return str.trim(); })
177
- .join(' ');
178
- };
179
- /**
180
- * Map %O to `util.inspect()`, allowing multiple lines if needed.
181
- */
182
-
183
-
184
- formatters.O = function (v) {
185
- this.inspectOpts.colors = this.useColors;
186
- return util.inspect(v, this.inspectOpts);
187
- };
188
- } (node, nodeExports));
189
- return nodeExports;
190
- }
191
-
192
- export { requireNode as __require };