@nuxt/devtools 0.0.0 → 0.1.0

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +242 -0
  3. package/cli.mjs +1 -2
  4. package/dist/chunks/index.mjs +47749 -0
  5. package/dist/chunks/module-main.mjs +8424 -0
  6. package/dist/chunks/vite-inspect.mjs +49 -0
  7. package/dist/chunks/vscode.mjs +40137 -0
  8. package/dist/chunks/vue-inspector.mjs +14 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.mjs +66 -0
  11. package/dist/client/200.html +7 -0
  12. package/dist/client/404.html +7 -0
  13. package/dist/client/__inspecting/index.html +7 -0
  14. package/dist/client/_nuxt/Badge.23dc2d8f.js +1 -0
  15. package/dist/client/_nuxt/ComponentItem.f7b53cb0.js +1 -0
  16. package/dist/client/_nuxt/ComponentItem.vue.d48d83d8.js +1 -0
  17. package/dist/client/_nuxt/ComponentsGraph.94420499.js +1 -0
  18. package/dist/client/_nuxt/ComponentsGraph.vue.687b60ce.js +1 -0
  19. package/dist/client/_nuxt/ComponentsList.27e171d0.js +1 -0
  20. package/dist/client/_nuxt/ComponentsList.vue.24e7149d.js +1 -0
  21. package/dist/client/_nuxt/ComposableItem.a0f590b3.js +1 -0
  22. package/dist/client/_nuxt/ComposableItem.vue.645a2668.js +1 -0
  23. package/dist/client/_nuxt/ComposableTree.08cf808f.js +1 -0
  24. package/dist/client/_nuxt/ComposableTree.vue.a160c715.js +1 -0
  25. package/dist/client/_nuxt/CurrentRoute.4a32c426.js +1 -0
  26. package/dist/client/_nuxt/Drawer.6d261f16.js +1 -0
  27. package/dist/client/_nuxt/Drawer.vue.4d7d190a.js +1 -0
  28. package/dist/client/_nuxt/DrawerItem.0c4e93e1.js +1 -0
  29. package/dist/client/_nuxt/DrawerItem.vue.30f032f8.js +1 -0
  30. package/dist/client/_nuxt/FileIcon.4f6c385a.js +1 -0
  31. package/dist/client/_nuxt/FileIcon.vue.e650fe14.js +1 -0
  32. package/dist/client/_nuxt/FilepathItem.6f861b0b.js +1 -0
  33. package/dist/client/_nuxt/FilepathItem.vue.fcbe3a7a.js +1 -0
  34. package/dist/client/_nuxt/HooksTable.e9c5c41d.js +1 -0
  35. package/dist/client/_nuxt/HooksTable.vue.93af23f8.js +1 -0
  36. package/dist/client/_nuxt/IconTitle.576c2413.js +1 -0
  37. package/dist/client/_nuxt/IconTitle.vue.909d2a6b.js +1 -0
  38. package/dist/client/_nuxt/IframeView.d58e614f.js +1 -0
  39. package/dist/client/_nuxt/IframeView.vue.46f9c325.js +1 -0
  40. package/dist/client/_nuxt/LaunchPage.7f56830a.js +1 -0
  41. package/dist/client/_nuxt/LaunchPage.vue.29133098.js +1 -0
  42. package/dist/client/_nuxt/ModuleItem.9523008d.js +1 -0
  43. package/dist/client/_nuxt/ModuleItem.vue.07190cb3.js +1 -0
  44. package/dist/client/_nuxt/ModuleTreeNode.040f6e05.js +1 -0
  45. package/dist/client/_nuxt/NButton.d5a0d397.js +1 -0
  46. package/dist/client/_nuxt/NButton.vue.3df758c5.js +1 -0
  47. package/dist/client/_nuxt/NCard.47038127.js +1 -0
  48. package/dist/client/_nuxt/NCheckbox.ec4f225e.js +1 -0
  49. package/dist/client/_nuxt/NCheckbox.vue.25b386b6.js +1 -0
  50. package/dist/client/_nuxt/NDarkToggle.46f06112.js +1 -0
  51. package/dist/client/_nuxt/NDarkToggle.vue.c227b1bd.js +1 -0
  52. package/dist/client/_nuxt/NDialog.09638209.js +7 -0
  53. package/dist/client/_nuxt/NDropdown.d94508d4.js +1 -0
  54. package/dist/client/_nuxt/NIcon.e9d8d4d5.js +1 -0
  55. package/dist/client/_nuxt/NIcon.vue.2481694f.js +1 -0
  56. package/dist/client/_nuxt/NLink.34fc60fd.js +1 -0
  57. package/dist/client/_nuxt/NLink.vue.17c2cd3a.js +1 -0
  58. package/dist/client/_nuxt/NRadio.a5c0205d.js +1 -0
  59. package/dist/client/_nuxt/NSwitch.4c2c96d6.js +1 -0
  60. package/dist/client/_nuxt/NSwitch.vue.36ec57ea.js +1 -0
  61. package/dist/client/_nuxt/NTextInput.3c1a9b08.js +1 -0
  62. package/dist/client/_nuxt/NTextInput.vue.2d3f9e19.js +1 -0
  63. package/dist/client/_nuxt/NTip.ff4fea4e.js +1 -0
  64. package/dist/client/_nuxt/Notification.f594eb13.js +1 -0
  65. package/dist/client/_nuxt/Notification.vue.b0304237.js +1 -0
  66. package/dist/client/_nuxt/NuxtContentLogo.1ca13565.js +1 -0
  67. package/dist/client/_nuxt/NuxtExampleLayout.904da69e.js +1 -0
  68. package/dist/client/_nuxt/NuxtLogo.acbeec62.js +1 -0
  69. package/dist/client/_nuxt/PluginItem.78f70695.js +1 -0
  70. package/dist/client/_nuxt/PluginItem.vue.a18a8580.js +1 -0
  71. package/dist/client/_nuxt/RoutePathItem.77ebd238.js +1 -0
  72. package/dist/client/_nuxt/RoutePathItem.vue.a16a2a5a.js +1 -0
  73. package/dist/client/_nuxt/RoutesTable.3a51b11e.js +1 -0
  74. package/dist/client/_nuxt/RoutesTable.vue.66423aa5.js +1 -0
  75. package/dist/client/_nuxt/SectionBlock.6bf10c9f.js +1 -0
  76. package/dist/client/_nuxt/SectionBlock.a75bb023.css +1 -0
  77. package/dist/client/_nuxt/Settings.ceefb680.js +1 -0
  78. package/dist/client/_nuxt/Settings.vue.6d6be237.js +1 -0
  79. package/dist/client/_nuxt/StateEditor.b25ca4bb.js +1 -0
  80. package/dist/client/_nuxt/StateEditor.f3649b84.css +1 -0
  81. package/dist/client/_nuxt/StateEditor.vue.4c95ce8f.js +135 -0
  82. package/dist/client/_nuxt/StateEditor.vue.94361847.js +1 -0
  83. package/dist/client/_nuxt/StateGroup.03356999.js +1 -0
  84. package/dist/client/_nuxt/StateGroup.vue.2dd6ea33.js +1 -0
  85. package/dist/client/_nuxt/TabIcon.0eec1314.js +1 -0
  86. package/dist/client/_nuxt/TabIcon.vue.8a3fdf6c.js +1 -0
  87. package/dist/client/_nuxt/UnoIcon.58399ac9.js +1 -0
  88. package/dist/client/_nuxt/__inspecting.06a43aaf.js +1 -0
  89. package/dist/client/_nuxt/_plugin-vue_export-helper.c27b6911.js +1 -0
  90. package/dist/client/_nuxt/app.config.a09258b3.js +1 -0
  91. package/dist/client/_nuxt/asyncData.0d07d609.js +1 -0
  92. package/dist/client/_nuxt/client-only.57dcb5bd.js +4 -0
  93. package/dist/client/_nuxt/client.ef9805ed.js +1 -0
  94. package/dist/client/_nuxt/color-mode-options.00c15dd1.js +1 -0
  95. package/dist/client/_nuxt/component.vue3.70214810.js +1 -0
  96. package/dist/client/_nuxt/components.238910b6.js +1 -0
  97. package/dist/client/_nuxt/components.bcdd3ff8.js +1 -0
  98. package/dist/client/_nuxt/components.client.73756aea.js +113 -0
  99. package/dist/client/_nuxt/composables.3d6ee8a2.js +1 -0
  100. package/dist/client/_nuxt/composables.7fd231ea.js +1 -0
  101. package/dist/client/_nuxt/context.dc73232e.js +1 -0
  102. package/dist/client/_nuxt/custom-_name_.3a92fd5f.js +1 -0
  103. package/dist/client/_nuxt/default.d86039a2.js +1 -0
  104. package/dist/client/_nuxt/dev-only.fb81821a.js +1 -0
  105. package/dist/client/_nuxt/editor.9a00fe97.js +1 -0
  106. package/dist/client/_nuxt/entry.1076cab0.js +1 -0
  107. package/dist/client/_nuxt/entry.53569115.css +1 -0
  108. package/dist/client/_nuxt/error-404.1469f10f.css +1 -0
  109. package/dist/client/_nuxt/error-404.f7be8ae4.js +1 -0
  110. package/dist/client/_nuxt/error-500.31030cf5.js +1 -0
  111. package/dist/client/_nuxt/error-500.92b94fae.css +1 -0
  112. package/dist/client/_nuxt/error-component.916ef420.js +3 -0
  113. package/dist/client/_nuxt/error.10b092f1.js +1 -0
  114. package/dist/client/_nuxt/fuse.esm.88e2763d.js +1 -0
  115. package/dist/client/_nuxt/hooks.03df1882.js +1 -0
  116. package/dist/client/_nuxt/icons.7b11eba5.js +1 -0
  117. package/dist/client/_nuxt/icons.d5925320.js +1 -0
  118. package/dist/client/_nuxt/icons.eca62571.js +1 -0
  119. package/dist/client/_nuxt/imports.0ab9b18e.js +1 -0
  120. package/dist/client/_nuxt/index.6cafd97e.js +1 -0
  121. package/dist/client/_nuxt/index.7c6751e3.js +1 -0
  122. package/dist/client/_nuxt/index.96e42b53.js +1 -0
  123. package/dist/client/_nuxt/index.a6656ecb.js +17 -0
  124. package/dist/client/_nuxt/index.adfbbcc3.js +1 -0
  125. package/dist/client/_nuxt/layout.50e89109.js +1 -0
  126. package/dist/client/_nuxt/layouts.22623cd4.js +1 -0
  127. package/dist/client/_nuxt/middleware.8875601d.js +1 -0
  128. package/dist/client/_nuxt/modules.4e9ddad7.js +1 -0
  129. package/dist/client/_nuxt/none.1c37aed4.js +1 -0
  130. package/dist/client/_nuxt/nuxt-error-boundary.fc4d7c25.js +1 -0
  131. package/dist/client/_nuxt/nuxt-link.724f8a66.js +1 -0
  132. package/dist/client/_nuxt/nuxt-loading-indicator.494ea32c.js +1 -0
  133. package/dist/client/_nuxt/overview.dca34e56.js +1 -0
  134. package/dist/client/_nuxt/page.8df04ed4.js +1 -0
  135. package/dist/client/_nuxt/pages.bdf1c147.js +1 -0
  136. package/dist/client/_nuxt/payload.8cf95895.js +1 -0
  137. package/dist/client/_nuxt/plugins.bb7d1e18.js +1 -0
  138. package/dist/client/_nuxt/rpc.65a41b65.js +1 -0
  139. package/dist/client/_nuxt/runtime-configs.e1c67255.js +1 -0
  140. package/dist/client/_nuxt/runtime-core.esm-bundler.5019e930.js +1 -0
  141. package/dist/client/_nuxt/runtime-dom.esm-bundler.b0076367.js +1 -0
  142. package/dist/client/_nuxt/server-placeholder.735ae8e9.js +1 -0
  143. package/dist/client/_nuxt/server-routes.ff745565.js +1 -0
  144. package/dist/client/_nuxt/state.5364a68a.js +1 -0
  145. package/dist/client/_nuxt/state.68f6a8e0.js +1 -0
  146. package/dist/client/_nuxt/storage.82519452.js +1 -0
  147. package/dist/client/_nuxt/unocss-runtime.cde2ffdd.js +2 -0
  148. package/dist/client/_nuxt/utils.3921fcc0.js +5 -0
  149. package/dist/client/_nuxt/utils.c2a3506b.js +1 -0
  150. package/dist/client/_nuxt/virtual-files.8b6129f7.js +9 -0
  151. package/dist/client/_nuxt/virtual-files.a8748389.css +1 -0
  152. package/dist/client/_nuxt/welcome.432c9232.js +1 -0
  153. package/dist/client/_nuxt/welcome.db724adb.css +1 -0
  154. package/dist/client/index.html +7 -0
  155. package/dist/client/modules/components/index.html +7 -0
  156. package/dist/client/modules/hooks/index.html +7 -0
  157. package/dist/client/modules/imports/index.html +7 -0
  158. package/dist/client/modules/layouts/index.html +7 -0
  159. package/dist/client/modules/middleware/index.html +7 -0
  160. package/dist/client/modules/modules/index.html +7 -0
  161. package/dist/client/modules/overview/index.html +7 -0
  162. package/dist/client/modules/pages/index.html +7 -0
  163. package/dist/client/modules/payload/index.html +7 -0
  164. package/dist/client/modules/plugins/index.html +7 -0
  165. package/dist/client/modules/runtime-configs/index.html +7 -0
  166. package/dist/client/modules/server-routes/index.html +7 -0
  167. package/dist/client/modules/virtual-files/index.html +7 -0
  168. package/dist/client/nuxt.svg +3 -0
  169. package/dist/dirs.d.ts +6 -0
  170. package/dist/dirs.mjs +9 -0
  171. package/dist/iframe-client.d.ts +13 -0
  172. package/dist/iframe-client.mjs +30 -0
  173. package/dist/module.cjs +5 -0
  174. package/dist/module.d.ts +33 -0
  175. package/dist/module.json +5 -0
  176. package/dist/module.mjs +6 -0
  177. package/dist/runtime/plugins/devtools.client.d.ts +2 -0
  178. package/dist/runtime/plugins/devtools.client.mjs +36 -0
  179. package/dist/runtime/plugins/view/Container.vue +95 -0
  180. package/dist/runtime/plugins/view/Frame.vue +270 -0
  181. package/dist/runtime/plugins/view/state.d.ts +10 -0
  182. package/dist/runtime/plugins/view/state.mjs +30 -0
  183. package/dist/runtime/plugins/view/utils.d.ts +4 -0
  184. package/dist/runtime/plugins/view/utils.mjs +39 -0
  185. package/dist/runtime/shared/hooks.d.ts +3 -0
  186. package/dist/runtime/shared/hooks.mjs +32 -0
  187. package/dist/shared/devtools.34d9e53a.mjs +68 -0
  188. package/dist/shared/devtools.7127abb3.mjs +4 -0
  189. package/dist/shared/devtools.8467d016.mjs +1504 -0
  190. package/dist/shared/devtools.861712a3.mjs +337 -0
  191. package/dist/types.d.ts +313 -0
  192. package/dist/types.mjs +1 -0
  193. package/iframe-client.d.ts +1 -0
  194. package/package.json +104 -2
  195. package/types.d.ts +1 -0
@@ -0,0 +1,1504 @@
1
+ import require$$0 from 'tty';
2
+ import require$$0$1 from 'util';
3
+ import require$$1 from 'os';
4
+ import require$$0__default from 'fs';
5
+ import require$$1$1 from 'path';
6
+
7
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
+
9
+ function getAugmentedNamespace(n) {
10
+ if (n.__esModule) return n;
11
+ var f = n.default;
12
+ if (typeof f == "function") {
13
+ var a = function a () {
14
+ if (this instanceof a) {
15
+ var args = [null];
16
+ args.push.apply(args, arguments);
17
+ var Ctor = Function.bind.apply(f, args);
18
+ return new Ctor();
19
+ }
20
+ return f.apply(this, arguments);
21
+ };
22
+ a.prototype = f.prototype;
23
+ } else a = {};
24
+ Object.defineProperty(a, '__esModule', {value: true});
25
+ Object.keys(n).forEach(function (k) {
26
+ var d = Object.getOwnPropertyDescriptor(n, k);
27
+ Object.defineProperty(a, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () {
30
+ return n[k];
31
+ }
32
+ });
33
+ });
34
+ return a;
35
+ }
36
+
37
+ var srcExports = {};
38
+ var src = {
39
+ get exports(){ return srcExports; },
40
+ set exports(v){ srcExports = v; },
41
+ };
42
+
43
+ var browserExports = {};
44
+ var browser = {
45
+ get exports(){ return browserExports; },
46
+ set exports(v){ browserExports = v; },
47
+ };
48
+
49
+ /**
50
+ * Helpers.
51
+ */
52
+
53
+ var ms;
54
+ var hasRequiredMs;
55
+
56
+ function requireMs () {
57
+ if (hasRequiredMs) return ms;
58
+ hasRequiredMs = 1;
59
+ var s = 1000;
60
+ var m = s * 60;
61
+ var h = m * 60;
62
+ var d = h * 24;
63
+ var w = d * 7;
64
+ var y = d * 365.25;
65
+
66
+ /**
67
+ * Parse or format the given `val`.
68
+ *
69
+ * Options:
70
+ *
71
+ * - `long` verbose formatting [false]
72
+ *
73
+ * @param {String|Number} val
74
+ * @param {Object} [options]
75
+ * @throws {Error} throw an error if val is not a non-empty string or a number
76
+ * @return {String|Number}
77
+ * @api public
78
+ */
79
+
80
+ ms = function(val, options) {
81
+ options = options || {};
82
+ var type = typeof val;
83
+ if (type === 'string' && val.length > 0) {
84
+ return parse(val);
85
+ } else if (type === 'number' && isFinite(val)) {
86
+ return options.long ? fmtLong(val) : fmtShort(val);
87
+ }
88
+ throw new Error(
89
+ 'val is not a non-empty string or a valid number. val=' +
90
+ JSON.stringify(val)
91
+ );
92
+ };
93
+
94
+ /**
95
+ * Parse the given `str` and return milliseconds.
96
+ *
97
+ * @param {String} str
98
+ * @return {Number}
99
+ * @api private
100
+ */
101
+
102
+ function parse(str) {
103
+ str = String(str);
104
+ if (str.length > 100) {
105
+ return;
106
+ }
107
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
108
+ str
109
+ );
110
+ if (!match) {
111
+ return;
112
+ }
113
+ var n = parseFloat(match[1]);
114
+ var type = (match[2] || 'ms').toLowerCase();
115
+ switch (type) {
116
+ case 'years':
117
+ case 'year':
118
+ case 'yrs':
119
+ case 'yr':
120
+ case 'y':
121
+ return n * y;
122
+ case 'weeks':
123
+ case 'week':
124
+ case 'w':
125
+ return n * w;
126
+ case 'days':
127
+ case 'day':
128
+ case 'd':
129
+ return n * d;
130
+ case 'hours':
131
+ case 'hour':
132
+ case 'hrs':
133
+ case 'hr':
134
+ case 'h':
135
+ return n * h;
136
+ case 'minutes':
137
+ case 'minute':
138
+ case 'mins':
139
+ case 'min':
140
+ case 'm':
141
+ return n * m;
142
+ case 'seconds':
143
+ case 'second':
144
+ case 'secs':
145
+ case 'sec':
146
+ case 's':
147
+ return n * s;
148
+ case 'milliseconds':
149
+ case 'millisecond':
150
+ case 'msecs':
151
+ case 'msec':
152
+ case 'ms':
153
+ return n;
154
+ default:
155
+ return undefined;
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Short format for `ms`.
161
+ *
162
+ * @param {Number} ms
163
+ * @return {String}
164
+ * @api private
165
+ */
166
+
167
+ function fmtShort(ms) {
168
+ var msAbs = Math.abs(ms);
169
+ if (msAbs >= d) {
170
+ return Math.round(ms / d) + 'd';
171
+ }
172
+ if (msAbs >= h) {
173
+ return Math.round(ms / h) + 'h';
174
+ }
175
+ if (msAbs >= m) {
176
+ return Math.round(ms / m) + 'm';
177
+ }
178
+ if (msAbs >= s) {
179
+ return Math.round(ms / s) + 's';
180
+ }
181
+ return ms + 'ms';
182
+ }
183
+
184
+ /**
185
+ * Long format for `ms`.
186
+ *
187
+ * @param {Number} ms
188
+ * @return {String}
189
+ * @api private
190
+ */
191
+
192
+ function fmtLong(ms) {
193
+ var msAbs = Math.abs(ms);
194
+ if (msAbs >= d) {
195
+ return plural(ms, msAbs, d, 'day');
196
+ }
197
+ if (msAbs >= h) {
198
+ return plural(ms, msAbs, h, 'hour');
199
+ }
200
+ if (msAbs >= m) {
201
+ return plural(ms, msAbs, m, 'minute');
202
+ }
203
+ if (msAbs >= s) {
204
+ return plural(ms, msAbs, s, 'second');
205
+ }
206
+ return ms + ' ms';
207
+ }
208
+
209
+ /**
210
+ * Pluralization helper.
211
+ */
212
+
213
+ function plural(ms, msAbs, n, name) {
214
+ var isPlural = msAbs >= n * 1.5;
215
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
216
+ }
217
+ return ms;
218
+ }
219
+
220
+ var common;
221
+ var hasRequiredCommon;
222
+
223
+ function requireCommon () {
224
+ if (hasRequiredCommon) return common;
225
+ hasRequiredCommon = 1;
226
+ /**
227
+ * This is the common logic for both the Node.js and web browser
228
+ * implementations of `debug()`.
229
+ */
230
+
231
+ function setup(env) {
232
+ createDebug.debug = createDebug;
233
+ createDebug.default = createDebug;
234
+ createDebug.coerce = coerce;
235
+ createDebug.disable = disable;
236
+ createDebug.enable = enable;
237
+ createDebug.enabled = enabled;
238
+ createDebug.humanize = requireMs();
239
+ createDebug.destroy = destroy;
240
+
241
+ Object.keys(env).forEach(key => {
242
+ createDebug[key] = env[key];
243
+ });
244
+
245
+ /**
246
+ * The currently active debug mode names, and names to skip.
247
+ */
248
+
249
+ createDebug.names = [];
250
+ createDebug.skips = [];
251
+
252
+ /**
253
+ * Map of special "%n" handling functions, for the debug "format" argument.
254
+ *
255
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
256
+ */
257
+ createDebug.formatters = {};
258
+
259
+ /**
260
+ * Selects a color for a debug namespace
261
+ * @param {String} namespace The namespace string for the debug instance to be colored
262
+ * @return {Number|String} An ANSI color code for the given namespace
263
+ * @api private
264
+ */
265
+ function selectColor(namespace) {
266
+ let hash = 0;
267
+
268
+ for (let i = 0; i < namespace.length; i++) {
269
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
270
+ hash |= 0; // Convert to 32bit integer
271
+ }
272
+
273
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
274
+ }
275
+ createDebug.selectColor = selectColor;
276
+
277
+ /**
278
+ * Create a debugger with the given `namespace`.
279
+ *
280
+ * @param {String} namespace
281
+ * @return {Function}
282
+ * @api public
283
+ */
284
+ function createDebug(namespace) {
285
+ let prevTime;
286
+ let enableOverride = null;
287
+ let namespacesCache;
288
+ let enabledCache;
289
+
290
+ function debug(...args) {
291
+ // Disabled?
292
+ if (!debug.enabled) {
293
+ return;
294
+ }
295
+
296
+ const self = debug;
297
+
298
+ // Set `diff` timestamp
299
+ const curr = Number(new Date());
300
+ const ms = curr - (prevTime || curr);
301
+ self.diff = ms;
302
+ self.prev = prevTime;
303
+ self.curr = curr;
304
+ prevTime = curr;
305
+
306
+ args[0] = createDebug.coerce(args[0]);
307
+
308
+ if (typeof args[0] !== 'string') {
309
+ // Anything else let's inspect with %O
310
+ args.unshift('%O');
311
+ }
312
+
313
+ // Apply any `formatters` transformations
314
+ let index = 0;
315
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
316
+ // If we encounter an escaped % then don't increase the array index
317
+ if (match === '%%') {
318
+ return '%';
319
+ }
320
+ index++;
321
+ const formatter = createDebug.formatters[format];
322
+ if (typeof formatter === 'function') {
323
+ const val = args[index];
324
+ match = formatter.call(self, val);
325
+
326
+ // Now we need to remove `args[index]` since it's inlined in the `format`
327
+ args.splice(index, 1);
328
+ index--;
329
+ }
330
+ return match;
331
+ });
332
+
333
+ // Apply env-specific formatting (colors, etc.)
334
+ createDebug.formatArgs.call(self, args);
335
+
336
+ const logFn = self.log || createDebug.log;
337
+ logFn.apply(self, args);
338
+ }
339
+
340
+ debug.namespace = namespace;
341
+ debug.useColors = createDebug.useColors();
342
+ debug.color = createDebug.selectColor(namespace);
343
+ debug.extend = extend;
344
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
345
+
346
+ Object.defineProperty(debug, 'enabled', {
347
+ enumerable: true,
348
+ configurable: false,
349
+ get: () => {
350
+ if (enableOverride !== null) {
351
+ return enableOverride;
352
+ }
353
+ if (namespacesCache !== createDebug.namespaces) {
354
+ namespacesCache = createDebug.namespaces;
355
+ enabledCache = createDebug.enabled(namespace);
356
+ }
357
+
358
+ return enabledCache;
359
+ },
360
+ set: v => {
361
+ enableOverride = v;
362
+ }
363
+ });
364
+
365
+ // Env-specific initialization logic for debug instances
366
+ if (typeof createDebug.init === 'function') {
367
+ createDebug.init(debug);
368
+ }
369
+
370
+ return debug;
371
+ }
372
+
373
+ function extend(namespace, delimiter) {
374
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
375
+ newDebug.log = this.log;
376
+ return newDebug;
377
+ }
378
+
379
+ /**
380
+ * Enables a debug mode by namespaces. This can include modes
381
+ * separated by a colon and wildcards.
382
+ *
383
+ * @param {String} namespaces
384
+ * @api public
385
+ */
386
+ function enable(namespaces) {
387
+ createDebug.save(namespaces);
388
+ createDebug.namespaces = namespaces;
389
+
390
+ createDebug.names = [];
391
+ createDebug.skips = [];
392
+
393
+ let i;
394
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
395
+ const len = split.length;
396
+
397
+ for (i = 0; i < len; i++) {
398
+ if (!split[i]) {
399
+ // ignore empty strings
400
+ continue;
401
+ }
402
+
403
+ namespaces = split[i].replace(/\*/g, '.*?');
404
+
405
+ if (namespaces[0] === '-') {
406
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
407
+ } else {
408
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
409
+ }
410
+ }
411
+ }
412
+
413
+ /**
414
+ * Disable debug output.
415
+ *
416
+ * @return {String} namespaces
417
+ * @api public
418
+ */
419
+ function disable() {
420
+ const namespaces = [
421
+ ...createDebug.names.map(toNamespace),
422
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
423
+ ].join(',');
424
+ createDebug.enable('');
425
+ return namespaces;
426
+ }
427
+
428
+ /**
429
+ * Returns true if the given mode name is enabled, false otherwise.
430
+ *
431
+ * @param {String} name
432
+ * @return {Boolean}
433
+ * @api public
434
+ */
435
+ function enabled(name) {
436
+ if (name[name.length - 1] === '*') {
437
+ return true;
438
+ }
439
+
440
+ let i;
441
+ let len;
442
+
443
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
444
+ if (createDebug.skips[i].test(name)) {
445
+ return false;
446
+ }
447
+ }
448
+
449
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
450
+ if (createDebug.names[i].test(name)) {
451
+ return true;
452
+ }
453
+ }
454
+
455
+ return false;
456
+ }
457
+
458
+ /**
459
+ * Convert regexp to namespace
460
+ *
461
+ * @param {RegExp} regxep
462
+ * @return {String} namespace
463
+ * @api private
464
+ */
465
+ function toNamespace(regexp) {
466
+ return regexp.toString()
467
+ .substring(2, regexp.toString().length - 2)
468
+ .replace(/\.\*\?$/, '*');
469
+ }
470
+
471
+ /**
472
+ * Coerce `val`.
473
+ *
474
+ * @param {Mixed} val
475
+ * @return {Mixed}
476
+ * @api private
477
+ */
478
+ function coerce(val) {
479
+ if (val instanceof Error) {
480
+ return val.stack || val.message;
481
+ }
482
+ return val;
483
+ }
484
+
485
+ /**
486
+ * XXX DO NOT USE. This is a temporary stub function.
487
+ * XXX It WILL be removed in the next major release.
488
+ */
489
+ function destroy() {
490
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
491
+ }
492
+
493
+ createDebug.enable(createDebug.load());
494
+
495
+ return createDebug;
496
+ }
497
+
498
+ common = setup;
499
+ return common;
500
+ }
501
+
502
+ /* eslint-env browser */
503
+
504
+ var hasRequiredBrowser;
505
+
506
+ function requireBrowser () {
507
+ if (hasRequiredBrowser) return browserExports;
508
+ hasRequiredBrowser = 1;
509
+ (function (module, exports) {
510
+ /**
511
+ * This is the web browser implementation of `debug()`.
512
+ */
513
+
514
+ exports.formatArgs = formatArgs;
515
+ exports.save = save;
516
+ exports.load = load;
517
+ exports.useColors = useColors;
518
+ exports.storage = localstorage();
519
+ exports.destroy = (() => {
520
+ let warned = false;
521
+
522
+ return () => {
523
+ if (!warned) {
524
+ warned = true;
525
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
526
+ }
527
+ };
528
+ })();
529
+
530
+ /**
531
+ * Colors.
532
+ */
533
+
534
+ exports.colors = [
535
+ '#0000CC',
536
+ '#0000FF',
537
+ '#0033CC',
538
+ '#0033FF',
539
+ '#0066CC',
540
+ '#0066FF',
541
+ '#0099CC',
542
+ '#0099FF',
543
+ '#00CC00',
544
+ '#00CC33',
545
+ '#00CC66',
546
+ '#00CC99',
547
+ '#00CCCC',
548
+ '#00CCFF',
549
+ '#3300CC',
550
+ '#3300FF',
551
+ '#3333CC',
552
+ '#3333FF',
553
+ '#3366CC',
554
+ '#3366FF',
555
+ '#3399CC',
556
+ '#3399FF',
557
+ '#33CC00',
558
+ '#33CC33',
559
+ '#33CC66',
560
+ '#33CC99',
561
+ '#33CCCC',
562
+ '#33CCFF',
563
+ '#6600CC',
564
+ '#6600FF',
565
+ '#6633CC',
566
+ '#6633FF',
567
+ '#66CC00',
568
+ '#66CC33',
569
+ '#9900CC',
570
+ '#9900FF',
571
+ '#9933CC',
572
+ '#9933FF',
573
+ '#99CC00',
574
+ '#99CC33',
575
+ '#CC0000',
576
+ '#CC0033',
577
+ '#CC0066',
578
+ '#CC0099',
579
+ '#CC00CC',
580
+ '#CC00FF',
581
+ '#CC3300',
582
+ '#CC3333',
583
+ '#CC3366',
584
+ '#CC3399',
585
+ '#CC33CC',
586
+ '#CC33FF',
587
+ '#CC6600',
588
+ '#CC6633',
589
+ '#CC9900',
590
+ '#CC9933',
591
+ '#CCCC00',
592
+ '#CCCC33',
593
+ '#FF0000',
594
+ '#FF0033',
595
+ '#FF0066',
596
+ '#FF0099',
597
+ '#FF00CC',
598
+ '#FF00FF',
599
+ '#FF3300',
600
+ '#FF3333',
601
+ '#FF3366',
602
+ '#FF3399',
603
+ '#FF33CC',
604
+ '#FF33FF',
605
+ '#FF6600',
606
+ '#FF6633',
607
+ '#FF9900',
608
+ '#FF9933',
609
+ '#FFCC00',
610
+ '#FFCC33'
611
+ ];
612
+
613
+ /**
614
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
615
+ * and the Firebug extension (any Firefox version) are known
616
+ * to support "%c" CSS customizations.
617
+ *
618
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
619
+ */
620
+
621
+ // eslint-disable-next-line complexity
622
+ function useColors() {
623
+ // NB: In an Electron preload script, document will be defined but not fully
624
+ // initialized. Since we know we're in Chrome, we'll just detect this case
625
+ // explicitly
626
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
627
+ return true;
628
+ }
629
+
630
+ // Internet Explorer and Edge do not support colors.
631
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
632
+ return false;
633
+ }
634
+
635
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
636
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
637
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
638
+ // Is firebug? http://stackoverflow.com/a/398120/376773
639
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
640
+ // Is firefox >= v31?
641
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
642
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
643
+ // Double check webkit in userAgent just in case we are in a worker
644
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
645
+ }
646
+
647
+ /**
648
+ * Colorize log arguments if enabled.
649
+ *
650
+ * @api public
651
+ */
652
+
653
+ function formatArgs(args) {
654
+ args[0] = (this.useColors ? '%c' : '') +
655
+ this.namespace +
656
+ (this.useColors ? ' %c' : ' ') +
657
+ args[0] +
658
+ (this.useColors ? '%c ' : ' ') +
659
+ '+' + module.exports.humanize(this.diff);
660
+
661
+ if (!this.useColors) {
662
+ return;
663
+ }
664
+
665
+ const c = 'color: ' + this.color;
666
+ args.splice(1, 0, c, 'color: inherit');
667
+
668
+ // The final "%c" is somewhat tricky, because there could be other
669
+ // arguments passed either before or after the %c, so we need to
670
+ // figure out the correct index to insert the CSS into
671
+ let index = 0;
672
+ let lastC = 0;
673
+ args[0].replace(/%[a-zA-Z%]/g, match => {
674
+ if (match === '%%') {
675
+ return;
676
+ }
677
+ index++;
678
+ if (match === '%c') {
679
+ // We only are interested in the *last* %c
680
+ // (the user may have provided their own)
681
+ lastC = index;
682
+ }
683
+ });
684
+
685
+ args.splice(lastC, 0, c);
686
+ }
687
+
688
+ /**
689
+ * Invokes `console.debug()` when available.
690
+ * No-op when `console.debug` is not a "function".
691
+ * If `console.debug` is not available, falls back
692
+ * to `console.log`.
693
+ *
694
+ * @api public
695
+ */
696
+ exports.log = console.debug || console.log || (() => {});
697
+
698
+ /**
699
+ * Save `namespaces`.
700
+ *
701
+ * @param {String} namespaces
702
+ * @api private
703
+ */
704
+ function save(namespaces) {
705
+ try {
706
+ if (namespaces) {
707
+ exports.storage.setItem('debug', namespaces);
708
+ } else {
709
+ exports.storage.removeItem('debug');
710
+ }
711
+ } catch (error) {
712
+ // Swallow
713
+ // XXX (@Qix-) should we be logging these?
714
+ }
715
+ }
716
+
717
+ /**
718
+ * Load `namespaces`.
719
+ *
720
+ * @return {String} returns the previously persisted debug modes
721
+ * @api private
722
+ */
723
+ function load() {
724
+ let r;
725
+ try {
726
+ r = exports.storage.getItem('debug');
727
+ } catch (error) {
728
+ // Swallow
729
+ // XXX (@Qix-) should we be logging these?
730
+ }
731
+
732
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
733
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
734
+ r = process.env.DEBUG;
735
+ }
736
+
737
+ return r;
738
+ }
739
+
740
+ /**
741
+ * Localstorage attempts to return the localstorage.
742
+ *
743
+ * This is necessary because safari throws
744
+ * when a user disables cookies/localstorage
745
+ * and you attempt to access it.
746
+ *
747
+ * @return {LocalStorage}
748
+ * @api private
749
+ */
750
+
751
+ function localstorage() {
752
+ try {
753
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
754
+ // The Browser also has localStorage in the global context.
755
+ return localStorage;
756
+ } catch (error) {
757
+ // Swallow
758
+ // XXX (@Qix-) should we be logging these?
759
+ }
760
+ }
761
+
762
+ module.exports = requireCommon()(exports);
763
+
764
+ const {formatters} = module.exports;
765
+
766
+ /**
767
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
768
+ */
769
+
770
+ formatters.j = function (v) {
771
+ try {
772
+ return JSON.stringify(v);
773
+ } catch (error) {
774
+ return '[UnexpectedJSONParseError]: ' + error.message;
775
+ }
776
+ };
777
+ } (browser, browserExports));
778
+ return browserExports;
779
+ }
780
+
781
+ var nodeExports = {};
782
+ var node = {
783
+ get exports(){ return nodeExports; },
784
+ set exports(v){ nodeExports = v; },
785
+ };
786
+
787
+ var hasFlag;
788
+ var hasRequiredHasFlag;
789
+
790
+ function requireHasFlag () {
791
+ if (hasRequiredHasFlag) return hasFlag;
792
+ hasRequiredHasFlag = 1;
793
+ hasFlag = (flag, argv) => {
794
+ argv = argv || process.argv;
795
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
796
+ const pos = argv.indexOf(prefix + flag);
797
+ const terminatorPos = argv.indexOf('--');
798
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
799
+ };
800
+ return hasFlag;
801
+ }
802
+
803
+ var supportsColor_1;
804
+ var hasRequiredSupportsColor;
805
+
806
+ function requireSupportsColor () {
807
+ if (hasRequiredSupportsColor) return supportsColor_1;
808
+ hasRequiredSupportsColor = 1;
809
+ const os = require$$1;
810
+ const hasFlag = requireHasFlag();
811
+
812
+ const env = process.env;
813
+
814
+ let forceColor;
815
+ if (hasFlag('no-color') ||
816
+ hasFlag('no-colors') ||
817
+ hasFlag('color=false')) {
818
+ forceColor = false;
819
+ } else if (hasFlag('color') ||
820
+ hasFlag('colors') ||
821
+ hasFlag('color=true') ||
822
+ hasFlag('color=always')) {
823
+ forceColor = true;
824
+ }
825
+ if ('FORCE_COLOR' in env) {
826
+ forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
827
+ }
828
+
829
+ function translateLevel(level) {
830
+ if (level === 0) {
831
+ return false;
832
+ }
833
+
834
+ return {
835
+ level,
836
+ hasBasic: true,
837
+ has256: level >= 2,
838
+ has16m: level >= 3
839
+ };
840
+ }
841
+
842
+ function supportsColor(stream) {
843
+ if (forceColor === false) {
844
+ return 0;
845
+ }
846
+
847
+ if (hasFlag('color=16m') ||
848
+ hasFlag('color=full') ||
849
+ hasFlag('color=truecolor')) {
850
+ return 3;
851
+ }
852
+
853
+ if (hasFlag('color=256')) {
854
+ return 2;
855
+ }
856
+
857
+ if (stream && !stream.isTTY && forceColor !== true) {
858
+ return 0;
859
+ }
860
+
861
+ const min = forceColor ? 1 : 0;
862
+
863
+ if (process.platform === 'win32') {
864
+ // Node.js 7.5.0 is the first version of Node.js to include a patch to
865
+ // libuv that enables 256 color output on Windows. Anything earlier and it
866
+ // won't work. However, here we target Node.js 8 at minimum as it is an LTS
867
+ // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
868
+ // release that supports 256 colors. Windows 10 build 14931 is the first release
869
+ // that supports 16m/TrueColor.
870
+ const osRelease = os.release().split('.');
871
+ if (
872
+ Number(process.versions.node.split('.')[0]) >= 8 &&
873
+ Number(osRelease[0]) >= 10 &&
874
+ Number(osRelease[2]) >= 10586
875
+ ) {
876
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
877
+ }
878
+
879
+ return 1;
880
+ }
881
+
882
+ if ('CI' in env) {
883
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
884
+ return 1;
885
+ }
886
+
887
+ return min;
888
+ }
889
+
890
+ if ('TEAMCITY_VERSION' in env) {
891
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
892
+ }
893
+
894
+ if (env.COLORTERM === 'truecolor') {
895
+ return 3;
896
+ }
897
+
898
+ if ('TERM_PROGRAM' in env) {
899
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
900
+
901
+ switch (env.TERM_PROGRAM) {
902
+ case 'iTerm.app':
903
+ return version >= 3 ? 3 : 2;
904
+ case 'Apple_Terminal':
905
+ return 2;
906
+ // No default
907
+ }
908
+ }
909
+
910
+ if (/-256(color)?$/i.test(env.TERM)) {
911
+ return 2;
912
+ }
913
+
914
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
915
+ return 1;
916
+ }
917
+
918
+ if ('COLORTERM' in env) {
919
+ return 1;
920
+ }
921
+
922
+ if (env.TERM === 'dumb') {
923
+ return min;
924
+ }
925
+
926
+ return min;
927
+ }
928
+
929
+ function getSupportLevel(stream) {
930
+ const level = supportsColor(stream);
931
+ return translateLevel(level);
932
+ }
933
+
934
+ supportsColor_1 = {
935
+ supportsColor: getSupportLevel,
936
+ stdout: getSupportLevel(process.stdout),
937
+ stderr: getSupportLevel(process.stderr)
938
+ };
939
+ return supportsColor_1;
940
+ }
941
+
942
+ /**
943
+ * Module dependencies.
944
+ */
945
+
946
+ var hasRequiredNode;
947
+
948
+ function requireNode () {
949
+ if (hasRequiredNode) return nodeExports;
950
+ hasRequiredNode = 1;
951
+ (function (module, exports) {
952
+ const tty = require$$0;
953
+ const util = require$$0$1;
954
+
955
+ /**
956
+ * This is the Node.js implementation of `debug()`.
957
+ */
958
+
959
+ exports.init = init;
960
+ exports.log = log;
961
+ exports.formatArgs = formatArgs;
962
+ exports.save = save;
963
+ exports.load = load;
964
+ exports.useColors = useColors;
965
+ exports.destroy = util.deprecate(
966
+ () => {},
967
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
968
+ );
969
+
970
+ /**
971
+ * Colors.
972
+ */
973
+
974
+ exports.colors = [6, 2, 3, 4, 5, 1];
975
+
976
+ try {
977
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
978
+ // eslint-disable-next-line import/no-extraneous-dependencies
979
+ const supportsColor = requireSupportsColor();
980
+
981
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
982
+ exports.colors = [
983
+ 20,
984
+ 21,
985
+ 26,
986
+ 27,
987
+ 32,
988
+ 33,
989
+ 38,
990
+ 39,
991
+ 40,
992
+ 41,
993
+ 42,
994
+ 43,
995
+ 44,
996
+ 45,
997
+ 56,
998
+ 57,
999
+ 62,
1000
+ 63,
1001
+ 68,
1002
+ 69,
1003
+ 74,
1004
+ 75,
1005
+ 76,
1006
+ 77,
1007
+ 78,
1008
+ 79,
1009
+ 80,
1010
+ 81,
1011
+ 92,
1012
+ 93,
1013
+ 98,
1014
+ 99,
1015
+ 112,
1016
+ 113,
1017
+ 128,
1018
+ 129,
1019
+ 134,
1020
+ 135,
1021
+ 148,
1022
+ 149,
1023
+ 160,
1024
+ 161,
1025
+ 162,
1026
+ 163,
1027
+ 164,
1028
+ 165,
1029
+ 166,
1030
+ 167,
1031
+ 168,
1032
+ 169,
1033
+ 170,
1034
+ 171,
1035
+ 172,
1036
+ 173,
1037
+ 178,
1038
+ 179,
1039
+ 184,
1040
+ 185,
1041
+ 196,
1042
+ 197,
1043
+ 198,
1044
+ 199,
1045
+ 200,
1046
+ 201,
1047
+ 202,
1048
+ 203,
1049
+ 204,
1050
+ 205,
1051
+ 206,
1052
+ 207,
1053
+ 208,
1054
+ 209,
1055
+ 214,
1056
+ 215,
1057
+ 220,
1058
+ 221
1059
+ ];
1060
+ }
1061
+ } catch (error) {
1062
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
1063
+ }
1064
+
1065
+ /**
1066
+ * Build up the default `inspectOpts` object from the environment variables.
1067
+ *
1068
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
1069
+ */
1070
+
1071
+ exports.inspectOpts = Object.keys(process.env).filter(key => {
1072
+ return /^debug_/i.test(key);
1073
+ }).reduce((obj, key) => {
1074
+ // Camel-case
1075
+ const prop = key
1076
+ .substring(6)
1077
+ .toLowerCase()
1078
+ .replace(/_([a-z])/g, (_, k) => {
1079
+ return k.toUpperCase();
1080
+ });
1081
+
1082
+ // Coerce string value into JS value
1083
+ let val = process.env[key];
1084
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
1085
+ val = true;
1086
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
1087
+ val = false;
1088
+ } else if (val === 'null') {
1089
+ val = null;
1090
+ } else {
1091
+ val = Number(val);
1092
+ }
1093
+
1094
+ obj[prop] = val;
1095
+ return obj;
1096
+ }, {});
1097
+
1098
+ /**
1099
+ * Is stdout a TTY? Colored output is enabled when `true`.
1100
+ */
1101
+
1102
+ function useColors() {
1103
+ return 'colors' in exports.inspectOpts ?
1104
+ Boolean(exports.inspectOpts.colors) :
1105
+ tty.isatty(process.stderr.fd);
1106
+ }
1107
+
1108
+ /**
1109
+ * Adds ANSI color escape codes if enabled.
1110
+ *
1111
+ * @api public
1112
+ */
1113
+
1114
+ function formatArgs(args) {
1115
+ const {namespace: name, useColors} = this;
1116
+
1117
+ if (useColors) {
1118
+ const c = this.color;
1119
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
1120
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
1121
+
1122
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
1123
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
1124
+ } else {
1125
+ args[0] = getDate() + name + ' ' + args[0];
1126
+ }
1127
+ }
1128
+
1129
+ function getDate() {
1130
+ if (exports.inspectOpts.hideDate) {
1131
+ return '';
1132
+ }
1133
+ return new Date().toISOString() + ' ';
1134
+ }
1135
+
1136
+ /**
1137
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
1138
+ */
1139
+
1140
+ function log(...args) {
1141
+ return process.stderr.write(util.format(...args) + '\n');
1142
+ }
1143
+
1144
+ /**
1145
+ * Save `namespaces`.
1146
+ *
1147
+ * @param {String} namespaces
1148
+ * @api private
1149
+ */
1150
+ function save(namespaces) {
1151
+ if (namespaces) {
1152
+ process.env.DEBUG = namespaces;
1153
+ } else {
1154
+ // If you set a process.env field to null or undefined, it gets cast to the
1155
+ // string 'null' or 'undefined'. Just delete instead.
1156
+ delete process.env.DEBUG;
1157
+ }
1158
+ }
1159
+
1160
+ /**
1161
+ * Load `namespaces`.
1162
+ *
1163
+ * @return {String} returns the previously persisted debug modes
1164
+ * @api private
1165
+ */
1166
+
1167
+ function load() {
1168
+ return process.env.DEBUG;
1169
+ }
1170
+
1171
+ /**
1172
+ * Init logic for `debug` instances.
1173
+ *
1174
+ * Create a new `inspectOpts` object in case `useColors` is set
1175
+ * differently for a particular `debug` instance.
1176
+ */
1177
+
1178
+ function init(debug) {
1179
+ debug.inspectOpts = {};
1180
+
1181
+ const keys = Object.keys(exports.inspectOpts);
1182
+ for (let i = 0; i < keys.length; i++) {
1183
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
1184
+ }
1185
+ }
1186
+
1187
+ module.exports = requireCommon()(exports);
1188
+
1189
+ const {formatters} = module.exports;
1190
+
1191
+ /**
1192
+ * Map %o to `util.inspect()`, all on a single line.
1193
+ */
1194
+
1195
+ formatters.o = function (v) {
1196
+ this.inspectOpts.colors = this.useColors;
1197
+ return util.inspect(v, this.inspectOpts)
1198
+ .split('\n')
1199
+ .map(str => str.trim())
1200
+ .join(' ');
1201
+ };
1202
+
1203
+ /**
1204
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
1205
+ */
1206
+
1207
+ formatters.O = function (v) {
1208
+ this.inspectOpts.colors = this.useColors;
1209
+ return util.inspect(v, this.inspectOpts);
1210
+ };
1211
+ } (node, nodeExports));
1212
+ return nodeExports;
1213
+ }
1214
+
1215
+ /**
1216
+ * Detect Electron renderer / nwjs process, which is node, but we should
1217
+ * treat as a browser.
1218
+ */
1219
+
1220
+ var hasRequiredSrc;
1221
+
1222
+ function requireSrc () {
1223
+ if (hasRequiredSrc) return srcExports;
1224
+ hasRequiredSrc = 1;
1225
+ (function (module) {
1226
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
1227
+ module.exports = requireBrowser();
1228
+ } else {
1229
+ module.exports = requireNode();
1230
+ }
1231
+ } (src));
1232
+ return srcExports;
1233
+ }
1234
+
1235
+ var windows;
1236
+ var hasRequiredWindows;
1237
+
1238
+ function requireWindows () {
1239
+ if (hasRequiredWindows) return windows;
1240
+ hasRequiredWindows = 1;
1241
+ windows = isexe;
1242
+ isexe.sync = sync;
1243
+
1244
+ var fs = require$$0__default;
1245
+
1246
+ function checkPathExt (path, options) {
1247
+ var pathext = options.pathExt !== undefined ?
1248
+ options.pathExt : process.env.PATHEXT;
1249
+
1250
+ if (!pathext) {
1251
+ return true
1252
+ }
1253
+
1254
+ pathext = pathext.split(';');
1255
+ if (pathext.indexOf('') !== -1) {
1256
+ return true
1257
+ }
1258
+ for (var i = 0; i < pathext.length; i++) {
1259
+ var p = pathext[i].toLowerCase();
1260
+ if (p && path.substr(-p.length).toLowerCase() === p) {
1261
+ return true
1262
+ }
1263
+ }
1264
+ return false
1265
+ }
1266
+
1267
+ function checkStat (stat, path, options) {
1268
+ if (!stat.isSymbolicLink() && !stat.isFile()) {
1269
+ return false
1270
+ }
1271
+ return checkPathExt(path, options)
1272
+ }
1273
+
1274
+ function isexe (path, options, cb) {
1275
+ fs.stat(path, function (er, stat) {
1276
+ cb(er, er ? false : checkStat(stat, path, options));
1277
+ });
1278
+ }
1279
+
1280
+ function sync (path, options) {
1281
+ return checkStat(fs.statSync(path), path, options)
1282
+ }
1283
+ return windows;
1284
+ }
1285
+
1286
+ var mode;
1287
+ var hasRequiredMode;
1288
+
1289
+ function requireMode () {
1290
+ if (hasRequiredMode) return mode;
1291
+ hasRequiredMode = 1;
1292
+ mode = isexe;
1293
+ isexe.sync = sync;
1294
+
1295
+ var fs = require$$0__default;
1296
+
1297
+ function isexe (path, options, cb) {
1298
+ fs.stat(path, function (er, stat) {
1299
+ cb(er, er ? false : checkStat(stat, options));
1300
+ });
1301
+ }
1302
+
1303
+ function sync (path, options) {
1304
+ return checkStat(fs.statSync(path), options)
1305
+ }
1306
+
1307
+ function checkStat (stat, options) {
1308
+ return stat.isFile() && checkMode(stat, options)
1309
+ }
1310
+
1311
+ function checkMode (stat, options) {
1312
+ var mod = stat.mode;
1313
+ var uid = stat.uid;
1314
+ var gid = stat.gid;
1315
+
1316
+ var myUid = options.uid !== undefined ?
1317
+ options.uid : process.getuid && process.getuid();
1318
+ var myGid = options.gid !== undefined ?
1319
+ options.gid : process.getgid && process.getgid();
1320
+
1321
+ var u = parseInt('100', 8);
1322
+ var g = parseInt('010', 8);
1323
+ var o = parseInt('001', 8);
1324
+ var ug = u | g;
1325
+
1326
+ var ret = (mod & o) ||
1327
+ (mod & g) && gid === myGid ||
1328
+ (mod & u) && uid === myUid ||
1329
+ (mod & ug) && myUid === 0;
1330
+
1331
+ return ret
1332
+ }
1333
+ return mode;
1334
+ }
1335
+
1336
+ var core;
1337
+ if (process.platform === 'win32' || commonjsGlobal.TESTING_WINDOWS) {
1338
+ core = requireWindows();
1339
+ } else {
1340
+ core = requireMode();
1341
+ }
1342
+
1343
+ var isexe_1 = isexe$1;
1344
+ isexe$1.sync = sync;
1345
+
1346
+ function isexe$1 (path, options, cb) {
1347
+ if (typeof options === 'function') {
1348
+ cb = options;
1349
+ options = {};
1350
+ }
1351
+
1352
+ if (!cb) {
1353
+ if (typeof Promise !== 'function') {
1354
+ throw new TypeError('callback not provided')
1355
+ }
1356
+
1357
+ return new Promise(function (resolve, reject) {
1358
+ isexe$1(path, options || {}, function (er, is) {
1359
+ if (er) {
1360
+ reject(er);
1361
+ } else {
1362
+ resolve(is);
1363
+ }
1364
+ });
1365
+ })
1366
+ }
1367
+
1368
+ core(path, options || {}, function (er, is) {
1369
+ // ignore EACCES because that just means we aren't allowed to run it
1370
+ if (er) {
1371
+ if (er.code === 'EACCES' || options && options.ignoreErrors) {
1372
+ er = null;
1373
+ is = false;
1374
+ }
1375
+ }
1376
+ cb(er, is);
1377
+ });
1378
+ }
1379
+
1380
+ function sync (path, options) {
1381
+ // my kingdom for a filtered catch
1382
+ try {
1383
+ return core.sync(path, options || {})
1384
+ } catch (er) {
1385
+ if (options && options.ignoreErrors || er.code === 'EACCES') {
1386
+ return false
1387
+ } else {
1388
+ throw er
1389
+ }
1390
+ }
1391
+ }
1392
+
1393
+ const isexe = isexe_1;
1394
+ const { join, delimiter, sep, posix } = require$$1$1;
1395
+
1396
+ const isWindows = process.platform === 'win32';
1397
+
1398
+ // used to check for slashed in commands passed in. always checks for the posix
1399
+ // seperator on all platforms, and checks for the current separator when not on
1400
+ // a posix platform. don't use the isWindows check for this since that is mocked
1401
+ // in tests but we still need the code to actually work when called. that is also
1402
+ // why it is ignored from coverage.
1403
+ /* istanbul ignore next */
1404
+ const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1'));
1405
+ const rRel = new RegExp(`^\\.${rSlash.source}`);
1406
+
1407
+ const getNotFoundError = (cmd) =>
1408
+ Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' });
1409
+
1410
+ const getPathInfo = (cmd, {
1411
+ path: optPath = process.env.PATH,
1412
+ pathExt: optPathExt = process.env.PATHEXT,
1413
+ delimiter: optDelimiter = delimiter,
1414
+ }) => {
1415
+ // If it has a slash, then we don't bother searching the pathenv.
1416
+ // just check the file itself, and that's it.
1417
+ const pathEnv = cmd.match(rSlash) ? [''] : [
1418
+ // windows always checks the cwd first
1419
+ ...(isWindows ? [process.cwd()] : []),
1420
+ ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),
1421
+ ];
1422
+
1423
+ if (isWindows) {
1424
+ const pathExtExe = optPathExt || ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter);
1425
+ const pathExt = pathExtExe.split(optDelimiter);
1426
+ if (cmd.includes('.') && pathExt[0] !== '') {
1427
+ pathExt.unshift('');
1428
+ }
1429
+ return { pathEnv, pathExt, pathExtExe }
1430
+ }
1431
+
1432
+ return { pathEnv, pathExt: [''] }
1433
+ };
1434
+
1435
+ const getPathPart = (raw, cmd) => {
1436
+ const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
1437
+ const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : '';
1438
+ return prefix + join(pathPart, cmd)
1439
+ };
1440
+
1441
+ const which = async (cmd, opt = {}) => {
1442
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
1443
+ const found = [];
1444
+
1445
+ for (const envPart of pathEnv) {
1446
+ const p = getPathPart(envPart, cmd);
1447
+
1448
+ for (const ext of pathExt) {
1449
+ const withExt = p + ext;
1450
+ const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
1451
+ if (is) {
1452
+ if (!opt.all) {
1453
+ return withExt
1454
+ }
1455
+ found.push(withExt);
1456
+ }
1457
+ }
1458
+ }
1459
+
1460
+ if (opt.all && found.length) {
1461
+ return found
1462
+ }
1463
+
1464
+ if (opt.nothrow) {
1465
+ return null
1466
+ }
1467
+
1468
+ throw getNotFoundError(cmd)
1469
+ };
1470
+
1471
+ const whichSync = (cmd, opt = {}) => {
1472
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
1473
+ const found = [];
1474
+
1475
+ for (const pathEnvPart of pathEnv) {
1476
+ const p = getPathPart(pathEnvPart, cmd);
1477
+
1478
+ for (const ext of pathExt) {
1479
+ const withExt = p + ext;
1480
+ const is = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
1481
+ if (is) {
1482
+ if (!opt.all) {
1483
+ return withExt
1484
+ }
1485
+ found.push(withExt);
1486
+ }
1487
+ }
1488
+ }
1489
+
1490
+ if (opt.all && found.length) {
1491
+ return found
1492
+ }
1493
+
1494
+ if (opt.nothrow) {
1495
+ return null
1496
+ }
1497
+
1498
+ throw getNotFoundError(cmd)
1499
+ };
1500
+
1501
+ var lib = which;
1502
+ which.sync = whichSync;
1503
+
1504
+ export { commonjsGlobal as c, getAugmentedNamespace as g, lib as l, requireSrc as r };