@infly/libs 2.0.42 → 2.0.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -67
- package/adapters/vue2/build/webpack5/inline-runtime-plugin.js +35 -0
- package/adapters/vue2/build/webpack5/remove-legacy-assets-plugin.js +84 -0
- package/adapters/vue2/build/webpack5/webpack.base.js +437 -0
- package/adapters/vue2/module/Permission.js +204 -0
- package/adapters/vue2/postinstall.js +46 -0
- package/adapters/vue2/project-preview.js +148 -0
- package/adapters/vue2/script-config.js +26 -0
- package/adapters/vue2/store/index.js +1 -0
- package/adapters/vue2/store/modules/user.js +268 -0
- package/bin/cli.js +71 -71
- package/build/build-dist/index.js +863 -863
- package/build/build-dist/script-management.js +5 -5
- package/build/docker/compose-command.js +74 -74
- package/build/docker/compose-release.js +91 -91
- package/build/webpack5/inline-runtime-plugin.js +1 -35
- package/build/webpack5/remove-legacy-assets-plugin.js +1 -84
- package/build/webpack5/webpack.base.js +1 -435
- package/compat/init.js +9 -0
- package/index.js +8 -20
- package/module/Permission.js +1 -204
- package/module/REST.js +31 -19
- package/module/TokenService.js +9 -0
- package/module/Uts.js +460 -7252
- package/module/cjs/request-url-rules.cjs +6 -0
- package/module/cjs/rest-error-rules.cjs +33 -0
- package/package.json +121 -92
- package/script/build/deps.js +1 -1
- package/script/build/webhook.js +3 -2
- package/script/git-automation/git-clone.js +3 -4
- package/script/git-automation/index.js +2 -2
- package/script/index.js +1 -26
- package/script/webhook/webhook.js +7 -2
- package/store/index.js +1 -0
- package/store/modules/user.js +1 -268
- package/tools/auto-export.js +1 -2
- package/tools/file-export.js +6 -4
- package/tools/project-command.js +194 -194
- package/tools/project-preview.js +1 -148
- package/tools/select-option.js +60 -60
- package/.prettierrc +0 -5
- package/build/build-dist/script-management.test.js +0 -16
- package/build/docker/compose-command.test.js +0 -148
- package/build/docker/compose-release.test.js +0 -101
- package/build/docker/docker-build-push.test.js +0 -124
- package/build/webpack5/webpack.base.test.js +0 -59
- package/lib/index.js +0 -6
- package/lib/server/connect.js +0 -3011
- package/lib/server/serve-static.js +0 -4848
- package/script/pts/cloud-scenes.mjs +0 -65
- package/script/pts/cloud.js +0 -151
- package/script/pts/generate-cloud-params.mjs +0 -210
- package/script/pts/generate-cloud-params.test.mjs +0 -67
- package/tools/project-command.test.js +0 -267
- package/tools/select-option.test.js +0 -52
- package/webpack.config.js +0 -38
|
@@ -1,4848 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ var __webpack_modules__ = ({
|
|
3
|
-
|
|
4
|
-
/***/ 16:
|
|
5
|
-
/***/ ((module) => {
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
module.exports = require("url");
|
|
9
|
-
|
|
10
|
-
/***/ }),
|
|
11
|
-
|
|
12
|
-
/***/ 18:
|
|
13
|
-
/***/ ((module) => {
|
|
14
|
-
|
|
15
|
-
"use strict";
|
|
16
|
-
module.exports = require("tty");
|
|
17
|
-
|
|
18
|
-
/***/ }),
|
|
19
|
-
|
|
20
|
-
/***/ 23:
|
|
21
|
-
/***/ ((module) => {
|
|
22
|
-
|
|
23
|
-
"use strict";
|
|
24
|
-
/*!
|
|
25
|
-
* encodeurl
|
|
26
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
27
|
-
* MIT Licensed
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Module exports.
|
|
34
|
-
* @public
|
|
35
|
-
*/
|
|
36
|
-
module.exports = encodeUrl;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
|
|
40
|
-
* and including invalid escape sequences.
|
|
41
|
-
* @private
|
|
42
|
-
*/
|
|
43
|
-
|
|
44
|
-
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x23-\x3B\x3D\x3F-\x5F\x61-\x7A\x7C\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* RegExp to match unmatched surrogate pair.
|
|
48
|
-
* @private
|
|
49
|
-
*/
|
|
50
|
-
|
|
51
|
-
var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* String to replace unmatched surrogate pair with.
|
|
55
|
-
* @private
|
|
56
|
-
*/
|
|
57
|
-
|
|
58
|
-
var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2';
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Encode a URL to a percent-encoded form, excluding already-encoded sequences.
|
|
62
|
-
*
|
|
63
|
-
* This function will take an already-encoded URL and encode all the non-URL
|
|
64
|
-
* code points. This function will not encode the "%" character unless it is
|
|
65
|
-
* not part of a valid sequence (`%20` will be left as-is, but `%foo` will
|
|
66
|
-
* be encoded as `%25foo`).
|
|
67
|
-
*
|
|
68
|
-
* This encode is meant to be "safe" and does not throw errors. It will try as
|
|
69
|
-
* hard as it can to properly encode the given URL, including replacing any raw,
|
|
70
|
-
* unpaired surrogate pairs with the Unicode replacement character prior to
|
|
71
|
-
* encoding.
|
|
72
|
-
*
|
|
73
|
-
* @param {string} url
|
|
74
|
-
* @return {string}
|
|
75
|
-
* @public
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
function encodeUrl(url) {
|
|
79
|
-
return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE).replace(ENCODE_CHARS_REGEXP, encodeURI);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/***/ }),
|
|
83
|
-
|
|
84
|
-
/***/ 68:
|
|
85
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Detect Electron renderer process, which is node, but we should
|
|
89
|
-
* treat as a browser.
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
if (typeof process !== 'undefined' && process.type === 'renderer') {
|
|
93
|
-
module.exports = __webpack_require__(192);
|
|
94
|
-
} else {
|
|
95
|
-
module.exports = __webpack_require__(498);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/***/ }),
|
|
99
|
-
|
|
100
|
-
/***/ 74:
|
|
101
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
102
|
-
|
|
103
|
-
"use strict";
|
|
104
|
-
/*!
|
|
105
|
-
* statuses
|
|
106
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
107
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
108
|
-
* MIT Licensed
|
|
109
|
-
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Module dependencies.
|
|
115
|
-
* @private
|
|
116
|
-
*/
|
|
117
|
-
var codes = __webpack_require__(900);
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Module exports.
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
module.exports = status;
|
|
125
|
-
|
|
126
|
-
// status code to message map
|
|
127
|
-
status.message = codes;
|
|
128
|
-
|
|
129
|
-
// status message (lower-case) to code map
|
|
130
|
-
status.code = createMessageToStatusCodeMap(codes);
|
|
131
|
-
|
|
132
|
-
// array of status codes
|
|
133
|
-
status.codes = createStatusCodeList(codes);
|
|
134
|
-
|
|
135
|
-
// status codes for redirects
|
|
136
|
-
status.redirect = {
|
|
137
|
-
300: true,
|
|
138
|
-
301: true,
|
|
139
|
-
302: true,
|
|
140
|
-
303: true,
|
|
141
|
-
305: true,
|
|
142
|
-
307: true,
|
|
143
|
-
308: true
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// status codes for empty bodies
|
|
147
|
-
status.empty = {
|
|
148
|
-
204: true,
|
|
149
|
-
205: true,
|
|
150
|
-
304: true
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// status codes for when you should retry the request
|
|
154
|
-
status.retry = {
|
|
155
|
-
502: true,
|
|
156
|
-
503: true,
|
|
157
|
-
504: true
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Create a map of message to status code.
|
|
162
|
-
* @private
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
function createMessageToStatusCodeMap(codes) {
|
|
166
|
-
var map = {};
|
|
167
|
-
Object.keys(codes).forEach(function forEachCode(code) {
|
|
168
|
-
var message = codes[code];
|
|
169
|
-
var status = Number(code);
|
|
170
|
-
|
|
171
|
-
// populate map
|
|
172
|
-
map[message.toLowerCase()] = status;
|
|
173
|
-
});
|
|
174
|
-
return map;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Create a list of all status codes.
|
|
179
|
-
* @private
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
function createStatusCodeList(codes) {
|
|
183
|
-
return Object.keys(codes).map(function mapCode(code) {
|
|
184
|
-
return Number(code);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Get the status code for given message.
|
|
190
|
-
* @private
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
function getStatusCode(message) {
|
|
194
|
-
var msg = message.toLowerCase();
|
|
195
|
-
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
|
|
196
|
-
throw new Error('invalid status message: "' + message + '"');
|
|
197
|
-
}
|
|
198
|
-
return status.code[msg];
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Get the status message for given code.
|
|
203
|
-
* @private
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
function getStatusMessage(code) {
|
|
207
|
-
if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
|
|
208
|
-
throw new Error('invalid status code: ' + code);
|
|
209
|
-
}
|
|
210
|
-
return status.message[code];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Get the status code.
|
|
215
|
-
*
|
|
216
|
-
* Given a number, this will throw if it is not a known status
|
|
217
|
-
* code, otherwise the code will be returned. Given a string,
|
|
218
|
-
* the string will be parsed for a number and return the code
|
|
219
|
-
* if valid, otherwise will lookup the code assuming this is
|
|
220
|
-
* the status message.
|
|
221
|
-
*
|
|
222
|
-
* @param {string|number} code
|
|
223
|
-
* @returns {number}
|
|
224
|
-
* @public
|
|
225
|
-
*/
|
|
226
|
-
|
|
227
|
-
function status(code) {
|
|
228
|
-
if (typeof code === 'number') {
|
|
229
|
-
return getStatusMessage(code);
|
|
230
|
-
}
|
|
231
|
-
if (typeof code !== 'string') {
|
|
232
|
-
throw new TypeError('code must be a number or string');
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// '403'
|
|
236
|
-
var n = parseInt(code, 10);
|
|
237
|
-
if (!isNaN(n)) {
|
|
238
|
-
return getStatusMessage(n);
|
|
239
|
-
}
|
|
240
|
-
return getStatusCode(code);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/***/ }),
|
|
244
|
-
|
|
245
|
-
/***/ 88:
|
|
246
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
247
|
-
|
|
248
|
-
"use strict";
|
|
249
|
-
/*!
|
|
250
|
-
* http-errors
|
|
251
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
252
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
253
|
-
* MIT Licensed
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Module dependencies.
|
|
260
|
-
* @private
|
|
261
|
-
*/
|
|
262
|
-
var deprecate = __webpack_require__(959)('http-errors');
|
|
263
|
-
var setPrototypeOf = __webpack_require__(127);
|
|
264
|
-
var statuses = __webpack_require__(74);
|
|
265
|
-
var inherits = __webpack_require__(726);
|
|
266
|
-
var toIdentifier = __webpack_require__(282);
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Module exports.
|
|
270
|
-
* @public
|
|
271
|
-
*/
|
|
272
|
-
|
|
273
|
-
module.exports = createError;
|
|
274
|
-
module.exports.HttpError = createHttpErrorConstructor();
|
|
275
|
-
module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError);
|
|
276
|
-
|
|
277
|
-
// Populate exports for all constructors
|
|
278
|
-
populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError);
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Get the code class of a status code.
|
|
282
|
-
* @private
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
function codeClass(status) {
|
|
286
|
-
return Number(String(status).charAt(0) + '00');
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Create a new HTTP Error.
|
|
291
|
-
*
|
|
292
|
-
* @returns {Error}
|
|
293
|
-
* @public
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
function createError() {
|
|
297
|
-
// so much arity going on ~_~
|
|
298
|
-
var err;
|
|
299
|
-
var msg;
|
|
300
|
-
var status = 500;
|
|
301
|
-
var props = {};
|
|
302
|
-
for (var i = 0; i < arguments.length; i++) {
|
|
303
|
-
var arg = arguments[i];
|
|
304
|
-
var type = typeof arg;
|
|
305
|
-
if (type === 'object' && arg instanceof Error) {
|
|
306
|
-
err = arg;
|
|
307
|
-
status = err.status || err.statusCode || status;
|
|
308
|
-
} else if (type === 'number' && i === 0) {
|
|
309
|
-
status = arg;
|
|
310
|
-
} else if (type === 'string') {
|
|
311
|
-
msg = arg;
|
|
312
|
-
} else if (type === 'object') {
|
|
313
|
-
props = arg;
|
|
314
|
-
} else {
|
|
315
|
-
throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
if (typeof status === 'number' && (status < 400 || status >= 600)) {
|
|
319
|
-
deprecate('non-error status code; use only 4xx or 5xx status codes');
|
|
320
|
-
}
|
|
321
|
-
if (typeof status !== 'number' || !statuses.message[status] && (status < 400 || status >= 600)) {
|
|
322
|
-
status = 500;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// constructor
|
|
326
|
-
var HttpError = createError[status] || createError[codeClass(status)];
|
|
327
|
-
if (!err) {
|
|
328
|
-
// create error
|
|
329
|
-
err = HttpError ? new HttpError(msg) : new Error(msg || statuses.message[status]);
|
|
330
|
-
Error.captureStackTrace(err, createError);
|
|
331
|
-
}
|
|
332
|
-
if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
|
|
333
|
-
// add properties to generic error
|
|
334
|
-
err.expose = status < 500;
|
|
335
|
-
err.status = err.statusCode = status;
|
|
336
|
-
}
|
|
337
|
-
for (var key in props) {
|
|
338
|
-
if (key !== 'status' && key !== 'statusCode') {
|
|
339
|
-
err[key] = props[key];
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
return err;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Create HTTP error abstract base class.
|
|
347
|
-
* @private
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
|
-
function createHttpErrorConstructor() {
|
|
351
|
-
function HttpError() {
|
|
352
|
-
throw new TypeError('cannot construct abstract class');
|
|
353
|
-
}
|
|
354
|
-
inherits(HttpError, Error);
|
|
355
|
-
return HttpError;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Create a constructor for a client error.
|
|
360
|
-
* @private
|
|
361
|
-
*/
|
|
362
|
-
|
|
363
|
-
function createClientErrorConstructor(HttpError, name, code) {
|
|
364
|
-
var className = toClassName(name);
|
|
365
|
-
function ClientError(message) {
|
|
366
|
-
// create the error object
|
|
367
|
-
var msg = message != null ? message : statuses.message[code];
|
|
368
|
-
var err = new Error(msg);
|
|
369
|
-
|
|
370
|
-
// capture a stack trace to the construction point
|
|
371
|
-
Error.captureStackTrace(err, ClientError);
|
|
372
|
-
|
|
373
|
-
// adjust the [[Prototype]]
|
|
374
|
-
setPrototypeOf(err, ClientError.prototype);
|
|
375
|
-
|
|
376
|
-
// redefine the error message
|
|
377
|
-
Object.defineProperty(err, 'message', {
|
|
378
|
-
enumerable: true,
|
|
379
|
-
configurable: true,
|
|
380
|
-
value: msg,
|
|
381
|
-
writable: true
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
// redefine the error name
|
|
385
|
-
Object.defineProperty(err, 'name', {
|
|
386
|
-
enumerable: false,
|
|
387
|
-
configurable: true,
|
|
388
|
-
value: className,
|
|
389
|
-
writable: true
|
|
390
|
-
});
|
|
391
|
-
return err;
|
|
392
|
-
}
|
|
393
|
-
inherits(ClientError, HttpError);
|
|
394
|
-
nameFunc(ClientError, className);
|
|
395
|
-
ClientError.prototype.status = code;
|
|
396
|
-
ClientError.prototype.statusCode = code;
|
|
397
|
-
ClientError.prototype.expose = true;
|
|
398
|
-
return ClientError;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Create function to test is a value is a HttpError.
|
|
403
|
-
* @private
|
|
404
|
-
*/
|
|
405
|
-
|
|
406
|
-
function createIsHttpErrorFunction(HttpError) {
|
|
407
|
-
return function isHttpError(val) {
|
|
408
|
-
if (!val || typeof val !== 'object') {
|
|
409
|
-
return false;
|
|
410
|
-
}
|
|
411
|
-
if (val instanceof HttpError) {
|
|
412
|
-
return true;
|
|
413
|
-
}
|
|
414
|
-
return val instanceof Error && typeof val.expose === 'boolean' && typeof val.statusCode === 'number' && val.status === val.statusCode;
|
|
415
|
-
};
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Create a constructor for a server error.
|
|
420
|
-
* @private
|
|
421
|
-
*/
|
|
422
|
-
|
|
423
|
-
function createServerErrorConstructor(HttpError, name, code) {
|
|
424
|
-
var className = toClassName(name);
|
|
425
|
-
function ServerError(message) {
|
|
426
|
-
// create the error object
|
|
427
|
-
var msg = message != null ? message : statuses.message[code];
|
|
428
|
-
var err = new Error(msg);
|
|
429
|
-
|
|
430
|
-
// capture a stack trace to the construction point
|
|
431
|
-
Error.captureStackTrace(err, ServerError);
|
|
432
|
-
|
|
433
|
-
// adjust the [[Prototype]]
|
|
434
|
-
setPrototypeOf(err, ServerError.prototype);
|
|
435
|
-
|
|
436
|
-
// redefine the error message
|
|
437
|
-
Object.defineProperty(err, 'message', {
|
|
438
|
-
enumerable: true,
|
|
439
|
-
configurable: true,
|
|
440
|
-
value: msg,
|
|
441
|
-
writable: true
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
// redefine the error name
|
|
445
|
-
Object.defineProperty(err, 'name', {
|
|
446
|
-
enumerable: false,
|
|
447
|
-
configurable: true,
|
|
448
|
-
value: className,
|
|
449
|
-
writable: true
|
|
450
|
-
});
|
|
451
|
-
return err;
|
|
452
|
-
}
|
|
453
|
-
inherits(ServerError, HttpError);
|
|
454
|
-
nameFunc(ServerError, className);
|
|
455
|
-
ServerError.prototype.status = code;
|
|
456
|
-
ServerError.prototype.statusCode = code;
|
|
457
|
-
ServerError.prototype.expose = false;
|
|
458
|
-
return ServerError;
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Set the name of a function, if possible.
|
|
463
|
-
* @private
|
|
464
|
-
*/
|
|
465
|
-
|
|
466
|
-
function nameFunc(func, name) {
|
|
467
|
-
var desc = Object.getOwnPropertyDescriptor(func, 'name');
|
|
468
|
-
if (desc && desc.configurable) {
|
|
469
|
-
desc.value = name;
|
|
470
|
-
Object.defineProperty(func, 'name', desc);
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* Populate the exports object with constructors for every error class.
|
|
476
|
-
* @private
|
|
477
|
-
*/
|
|
478
|
-
|
|
479
|
-
function populateConstructorExports(exports, codes, HttpError) {
|
|
480
|
-
codes.forEach(function forEachCode(code) {
|
|
481
|
-
var CodeError;
|
|
482
|
-
var name = toIdentifier(statuses.message[code]);
|
|
483
|
-
switch (codeClass(code)) {
|
|
484
|
-
case 400:
|
|
485
|
-
CodeError = createClientErrorConstructor(HttpError, name, code);
|
|
486
|
-
break;
|
|
487
|
-
case 500:
|
|
488
|
-
CodeError = createServerErrorConstructor(HttpError, name, code);
|
|
489
|
-
break;
|
|
490
|
-
}
|
|
491
|
-
if (CodeError) {
|
|
492
|
-
// export the constructor
|
|
493
|
-
exports[code] = CodeError;
|
|
494
|
-
exports[name] = CodeError;
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* Get a class name from a name identifier.
|
|
501
|
-
* @private
|
|
502
|
-
*/
|
|
503
|
-
|
|
504
|
-
function toClassName(name) {
|
|
505
|
-
return name.substr(-5) !== 'Error' ? name + 'Error' : name;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
/***/ }),
|
|
509
|
-
|
|
510
|
-
/***/ 100:
|
|
511
|
-
/***/ ((module) => {
|
|
512
|
-
|
|
513
|
-
"use strict";
|
|
514
|
-
module.exports = /*#__PURE__*/JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}');
|
|
515
|
-
|
|
516
|
-
/***/ }),
|
|
517
|
-
|
|
518
|
-
/***/ 106:
|
|
519
|
-
/***/ ((module) => {
|
|
520
|
-
|
|
521
|
-
"use strict";
|
|
522
|
-
module.exports = require("zlib");
|
|
523
|
-
|
|
524
|
-
/***/ }),
|
|
525
|
-
|
|
526
|
-
/***/ 127:
|
|
527
|
-
/***/ ((module) => {
|
|
528
|
-
|
|
529
|
-
"use strict";
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
/* eslint no-proto: 0 */
|
|
533
|
-
module.exports = Object.setPrototypeOf || ({
|
|
534
|
-
__proto__: []
|
|
535
|
-
} instanceof Array ? setProtoOf : mixinProperties);
|
|
536
|
-
function setProtoOf(obj, proto) {
|
|
537
|
-
obj.__proto__ = proto;
|
|
538
|
-
return obj;
|
|
539
|
-
}
|
|
540
|
-
function mixinProperties(obj, proto) {
|
|
541
|
-
for (var prop in proto) {
|
|
542
|
-
if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
543
|
-
obj[prop] = proto[prop];
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
return obj;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
/***/ }),
|
|
550
|
-
|
|
551
|
-
/***/ 192:
|
|
552
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* This is the web browser implementation of `debug()`.
|
|
556
|
-
*
|
|
557
|
-
* Expose `debug()` as the module.
|
|
558
|
-
*/
|
|
559
|
-
|
|
560
|
-
exports = module.exports = __webpack_require__(843);
|
|
561
|
-
exports.log = log;
|
|
562
|
-
exports.formatArgs = formatArgs;
|
|
563
|
-
exports.save = save;
|
|
564
|
-
exports.load = load;
|
|
565
|
-
exports.useColors = useColors;
|
|
566
|
-
exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* Colors.
|
|
570
|
-
*/
|
|
571
|
-
|
|
572
|
-
exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
576
|
-
* and the Firebug extension (any Firefox version) are known
|
|
577
|
-
* to support "%c" CSS customizations.
|
|
578
|
-
*
|
|
579
|
-
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
580
|
-
*/
|
|
581
|
-
|
|
582
|
-
function useColors() {
|
|
583
|
-
// NB: In an Electron preload script, document will be defined but not fully
|
|
584
|
-
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
585
|
-
// explicitly
|
|
586
|
-
if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
|
|
587
|
-
return true;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
// is webkit? http://stackoverflow.com/a/16459606/376773
|
|
591
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
592
|
-
return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
|
593
|
-
// is firebug? http://stackoverflow.com/a/398120/376773
|
|
594
|
-
typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
|
595
|
-
// is firefox >= v31?
|
|
596
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
597
|
-
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
|
598
|
-
// double check webkit in userAgent just in case we are in a worker
|
|
599
|
-
typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
604
|
-
*/
|
|
605
|
-
|
|
606
|
-
exports.formatters.j = function (v) {
|
|
607
|
-
try {
|
|
608
|
-
return JSON.stringify(v);
|
|
609
|
-
} catch (err) {
|
|
610
|
-
return '[UnexpectedJSONParseError]: ' + err.message;
|
|
611
|
-
}
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Colorize log arguments if enabled.
|
|
616
|
-
*
|
|
617
|
-
* @api public
|
|
618
|
-
*/
|
|
619
|
-
|
|
620
|
-
function formatArgs(args) {
|
|
621
|
-
var useColors = this.useColors;
|
|
622
|
-
args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
|
|
623
|
-
if (!useColors) return;
|
|
624
|
-
var c = 'color: ' + this.color;
|
|
625
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
626
|
-
|
|
627
|
-
// the final "%c" is somewhat tricky, because there could be other
|
|
628
|
-
// arguments passed either before or after the %c, so we need to
|
|
629
|
-
// figure out the correct index to insert the CSS into
|
|
630
|
-
var index = 0;
|
|
631
|
-
var lastC = 0;
|
|
632
|
-
args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
|
633
|
-
if ('%%' === match) return;
|
|
634
|
-
index++;
|
|
635
|
-
if ('%c' === match) {
|
|
636
|
-
// we only are interested in the *last* %c
|
|
637
|
-
// (the user may have provided their own)
|
|
638
|
-
lastC = index;
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
args.splice(lastC, 0, c);
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Invokes `console.log()` when available.
|
|
646
|
-
* No-op when `console.log` is not a "function".
|
|
647
|
-
*
|
|
648
|
-
* @api public
|
|
649
|
-
*/
|
|
650
|
-
|
|
651
|
-
function log() {
|
|
652
|
-
// this hackery is required for IE8/9, where
|
|
653
|
-
// the `console.log` function doesn't have 'apply'
|
|
654
|
-
return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
/**
|
|
658
|
-
* Save `namespaces`.
|
|
659
|
-
*
|
|
660
|
-
* @param {String} namespaces
|
|
661
|
-
* @api private
|
|
662
|
-
*/
|
|
663
|
-
|
|
664
|
-
function save(namespaces) {
|
|
665
|
-
try {
|
|
666
|
-
if (null == namespaces) {
|
|
667
|
-
exports.storage.removeItem('debug');
|
|
668
|
-
} else {
|
|
669
|
-
exports.storage.debug = namespaces;
|
|
670
|
-
}
|
|
671
|
-
} catch (e) {}
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Load `namespaces`.
|
|
676
|
-
*
|
|
677
|
-
* @return {String} returns the previously persisted debug modes
|
|
678
|
-
* @api private
|
|
679
|
-
*/
|
|
680
|
-
|
|
681
|
-
function load() {
|
|
682
|
-
var r;
|
|
683
|
-
try {
|
|
684
|
-
r = exports.storage.debug;
|
|
685
|
-
} catch (e) {}
|
|
686
|
-
|
|
687
|
-
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
688
|
-
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
689
|
-
r = process.env.DEBUG;
|
|
690
|
-
}
|
|
691
|
-
return r;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
* Enable namespaces listed in `localStorage.debug` initially.
|
|
696
|
-
*/
|
|
697
|
-
|
|
698
|
-
exports.enable(load());
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* Localstorage attempts to return the localstorage.
|
|
702
|
-
*
|
|
703
|
-
* This is necessary because safari throws
|
|
704
|
-
* when a user disables cookies/localstorage
|
|
705
|
-
* and you attempt to access it.
|
|
706
|
-
*
|
|
707
|
-
* @return {LocalStorage}
|
|
708
|
-
* @api private
|
|
709
|
-
*/
|
|
710
|
-
|
|
711
|
-
function localstorage() {
|
|
712
|
-
try {
|
|
713
|
-
return window.localStorage;
|
|
714
|
-
} catch (e) {}
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
/***/ }),
|
|
718
|
-
|
|
719
|
-
/***/ 193:
|
|
720
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
721
|
-
|
|
722
|
-
"use strict";
|
|
723
|
-
/*!
|
|
724
|
-
* etag
|
|
725
|
-
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
726
|
-
* MIT Licensed
|
|
727
|
-
*/
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Module exports.
|
|
733
|
-
* @public
|
|
734
|
-
*/
|
|
735
|
-
module.exports = etag;
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* Module dependencies.
|
|
739
|
-
* @private
|
|
740
|
-
*/
|
|
741
|
-
|
|
742
|
-
var crypto = __webpack_require__(982);
|
|
743
|
-
var Stats = (__webpack_require__(896).Stats);
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* Module variables.
|
|
747
|
-
* @private
|
|
748
|
-
*/
|
|
749
|
-
|
|
750
|
-
var toString = Object.prototype.toString;
|
|
751
|
-
|
|
752
|
-
/**
|
|
753
|
-
* Generate an entity tag.
|
|
754
|
-
*
|
|
755
|
-
* @param {Buffer|string} entity
|
|
756
|
-
* @return {string}
|
|
757
|
-
* @private
|
|
758
|
-
*/
|
|
759
|
-
|
|
760
|
-
function entitytag(entity) {
|
|
761
|
-
if (entity.length === 0) {
|
|
762
|
-
// fast-path empty
|
|
763
|
-
return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
// compute hash of entity
|
|
767
|
-
var hash = crypto.createHash('sha1').update(entity, 'utf8').digest('base64').substring(0, 27);
|
|
768
|
-
|
|
769
|
-
// compute length of entity
|
|
770
|
-
var len = typeof entity === 'string' ? Buffer.byteLength(entity, 'utf8') : entity.length;
|
|
771
|
-
return '"' + len.toString(16) + '-' + hash + '"';
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Create a simple ETag.
|
|
776
|
-
*
|
|
777
|
-
* @param {string|Buffer|Stats} entity
|
|
778
|
-
* @param {object} [options]
|
|
779
|
-
* @param {boolean} [options.weak]
|
|
780
|
-
* @return {String}
|
|
781
|
-
* @public
|
|
782
|
-
*/
|
|
783
|
-
|
|
784
|
-
function etag(entity, options) {
|
|
785
|
-
if (entity == null) {
|
|
786
|
-
throw new TypeError('argument entity is required');
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
// support fs.Stats object
|
|
790
|
-
var isStats = isstats(entity);
|
|
791
|
-
var weak = options && typeof options.weak === 'boolean' ? options.weak : isStats;
|
|
792
|
-
|
|
793
|
-
// validate argument
|
|
794
|
-
if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) {
|
|
795
|
-
throw new TypeError('argument entity must be string, Buffer, or fs.Stats');
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
// generate entity tag
|
|
799
|
-
var tag = isStats ? stattag(entity) : entitytag(entity);
|
|
800
|
-
return weak ? 'W/' + tag : tag;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
/**
|
|
804
|
-
* Determine if object is a Stats object.
|
|
805
|
-
*
|
|
806
|
-
* @param {object} obj
|
|
807
|
-
* @return {boolean}
|
|
808
|
-
* @api private
|
|
809
|
-
*/
|
|
810
|
-
|
|
811
|
-
function isstats(obj) {
|
|
812
|
-
// genuine fs.Stats
|
|
813
|
-
if (typeof Stats === 'function' && obj instanceof Stats) {
|
|
814
|
-
return true;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
// quack quack
|
|
818
|
-
return obj && typeof obj === 'object' && 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && 'ino' in obj && typeof obj.ino === 'number' && 'size' in obj && typeof obj.size === 'number';
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
/**
|
|
822
|
-
* Generate a tag for a stat.
|
|
823
|
-
*
|
|
824
|
-
* @param {object} stat
|
|
825
|
-
* @return {string}
|
|
826
|
-
* @private
|
|
827
|
-
*/
|
|
828
|
-
|
|
829
|
-
function stattag(stat) {
|
|
830
|
-
var mtime = stat.mtime.getTime().toString(16);
|
|
831
|
-
var size = stat.size.toString(16);
|
|
832
|
-
return '"' + size + '-' + mtime + '"';
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
/***/ }),
|
|
836
|
-
|
|
837
|
-
/***/ 203:
|
|
838
|
-
/***/ ((module) => {
|
|
839
|
-
|
|
840
|
-
"use strict";
|
|
841
|
-
module.exports = require("stream");
|
|
842
|
-
|
|
843
|
-
/***/ }),
|
|
844
|
-
|
|
845
|
-
/***/ 252:
|
|
846
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
847
|
-
|
|
848
|
-
"use strict";
|
|
849
|
-
/*!
|
|
850
|
-
* parseurl
|
|
851
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
852
|
-
* Copyright(c) 2014-2017 Douglas Christopher Wilson
|
|
853
|
-
* MIT Licensed
|
|
854
|
-
*/
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
/**
|
|
859
|
-
* Module dependencies.
|
|
860
|
-
* @private
|
|
861
|
-
*/
|
|
862
|
-
var url = __webpack_require__(16);
|
|
863
|
-
var parse = url.parse;
|
|
864
|
-
var Url = url.Url;
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* Module exports.
|
|
868
|
-
* @public
|
|
869
|
-
*/
|
|
870
|
-
|
|
871
|
-
module.exports = parseurl;
|
|
872
|
-
module.exports.original = originalurl;
|
|
873
|
-
|
|
874
|
-
/**
|
|
875
|
-
* Parse the `req` url with memoization.
|
|
876
|
-
*
|
|
877
|
-
* @param {ServerRequest} req
|
|
878
|
-
* @return {Object}
|
|
879
|
-
* @public
|
|
880
|
-
*/
|
|
881
|
-
|
|
882
|
-
function parseurl(req) {
|
|
883
|
-
var url = req.url;
|
|
884
|
-
if (url === undefined) {
|
|
885
|
-
// URL is undefined
|
|
886
|
-
return undefined;
|
|
887
|
-
}
|
|
888
|
-
var parsed = req._parsedUrl;
|
|
889
|
-
if (fresh(url, parsed)) {
|
|
890
|
-
// Return cached URL parse
|
|
891
|
-
return parsed;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
// Parse the URL
|
|
895
|
-
parsed = fastparse(url);
|
|
896
|
-
parsed._raw = url;
|
|
897
|
-
return req._parsedUrl = parsed;
|
|
898
|
-
}
|
|
899
|
-
;
|
|
900
|
-
|
|
901
|
-
/**
|
|
902
|
-
* Parse the `req` original url with fallback and memoization.
|
|
903
|
-
*
|
|
904
|
-
* @param {ServerRequest} req
|
|
905
|
-
* @return {Object}
|
|
906
|
-
* @public
|
|
907
|
-
*/
|
|
908
|
-
|
|
909
|
-
function originalurl(req) {
|
|
910
|
-
var url = req.originalUrl;
|
|
911
|
-
if (typeof url !== 'string') {
|
|
912
|
-
// Fallback
|
|
913
|
-
return parseurl(req);
|
|
914
|
-
}
|
|
915
|
-
var parsed = req._parsedOriginalUrl;
|
|
916
|
-
if (fresh(url, parsed)) {
|
|
917
|
-
// Return cached URL parse
|
|
918
|
-
return parsed;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
// Parse the URL
|
|
922
|
-
parsed = fastparse(url);
|
|
923
|
-
parsed._raw = url;
|
|
924
|
-
return req._parsedOriginalUrl = parsed;
|
|
925
|
-
}
|
|
926
|
-
;
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Parse the `str` url with fast-path short-cut.
|
|
930
|
-
*
|
|
931
|
-
* @param {string} str
|
|
932
|
-
* @return {Object}
|
|
933
|
-
* @private
|
|
934
|
-
*/
|
|
935
|
-
|
|
936
|
-
function fastparse(str) {
|
|
937
|
-
if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
|
|
938
|
-
return parse(str);
|
|
939
|
-
}
|
|
940
|
-
var pathname = str;
|
|
941
|
-
var query = null;
|
|
942
|
-
var search = null;
|
|
943
|
-
|
|
944
|
-
// This takes the regexp from https://github.com/joyent/node/pull/7878
|
|
945
|
-
// Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
|
|
946
|
-
// And unrolls it into a for loop
|
|
947
|
-
for (var i = 1; i < str.length; i++) {
|
|
948
|
-
switch (str.charCodeAt(i)) {
|
|
949
|
-
case 0x3f:
|
|
950
|
-
/* ? */
|
|
951
|
-
if (search === null) {
|
|
952
|
-
pathname = str.substring(0, i);
|
|
953
|
-
query = str.substring(i + 1);
|
|
954
|
-
search = str.substring(i);
|
|
955
|
-
}
|
|
956
|
-
break;
|
|
957
|
-
case 0x09: /* \t */
|
|
958
|
-
case 0x0a: /* \n */
|
|
959
|
-
case 0x0c: /* \f */
|
|
960
|
-
case 0x0d: /* \r */
|
|
961
|
-
case 0x20: /* */
|
|
962
|
-
case 0x23: /* # */
|
|
963
|
-
case 0xa0:
|
|
964
|
-
case 0xfeff:
|
|
965
|
-
return parse(str);
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
var url = Url !== undefined ? new Url() : {};
|
|
969
|
-
url.path = str;
|
|
970
|
-
url.href = str;
|
|
971
|
-
url.pathname = pathname;
|
|
972
|
-
if (search !== null) {
|
|
973
|
-
url.query = query;
|
|
974
|
-
url.search = search;
|
|
975
|
-
}
|
|
976
|
-
return url;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* Determine if parsed is still fresh for url.
|
|
981
|
-
*
|
|
982
|
-
* @param {string} url
|
|
983
|
-
* @param {object} parsedUrl
|
|
984
|
-
* @return {boolean}
|
|
985
|
-
* @private
|
|
986
|
-
*/
|
|
987
|
-
|
|
988
|
-
function fresh(url, parsedUrl) {
|
|
989
|
-
return typeof parsedUrl === 'object' && parsedUrl !== null && (Url === undefined || parsedUrl instanceof Url) && parsedUrl._raw === url;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
/***/ }),
|
|
993
|
-
|
|
994
|
-
/***/ 268:
|
|
995
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
996
|
-
|
|
997
|
-
// 集中导出常用方法
|
|
998
|
-
module.exports = {
|
|
999
|
-
// connect: require('connect'),
|
|
1000
|
-
serveStatic: __webpack_require__(804)
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
/***/ }),
|
|
1004
|
-
|
|
1005
|
-
/***/ 274:
|
|
1006
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1007
|
-
|
|
1008
|
-
var path = __webpack_require__(928);
|
|
1009
|
-
var fs = __webpack_require__(896);
|
|
1010
|
-
function Mime() {
|
|
1011
|
-
// Map of extension -> mime type
|
|
1012
|
-
this.types = Object.create(null);
|
|
1013
|
-
|
|
1014
|
-
// Map of mime type -> extension
|
|
1015
|
-
this.extensions = Object.create(null);
|
|
1016
|
-
}
|
|
1017
|
-
|
|
1018
|
-
/**
|
|
1019
|
-
* Define mimetype -> extension mappings. Each key is a mime-type that maps
|
|
1020
|
-
* to an array of extensions associated with the type. The first extension is
|
|
1021
|
-
* used as the default extension for the type.
|
|
1022
|
-
*
|
|
1023
|
-
* e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
|
|
1024
|
-
*
|
|
1025
|
-
* @param map (Object) type definitions
|
|
1026
|
-
*/
|
|
1027
|
-
Mime.prototype.define = function (map) {
|
|
1028
|
-
for (var type in map) {
|
|
1029
|
-
var exts = map[type];
|
|
1030
|
-
for (var i = 0; i < exts.length; i++) {
|
|
1031
|
-
if (process.env.DEBUG_MIME && this.types[exts[i]]) {
|
|
1032
|
-
console.warn((this._loading || "define()").replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + ' to ' + type);
|
|
1033
|
-
}
|
|
1034
|
-
this.types[exts[i]] = type;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
// Default extension is the first one we encounter
|
|
1038
|
-
if (!this.extensions[type]) {
|
|
1039
|
-
this.extensions[type] = exts[0];
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
};
|
|
1043
|
-
|
|
1044
|
-
/**
|
|
1045
|
-
* Load an Apache2-style ".types" file
|
|
1046
|
-
*
|
|
1047
|
-
* This may be called multiple times (it's expected). Where files declare
|
|
1048
|
-
* overlapping types/extensions, the last file wins.
|
|
1049
|
-
*
|
|
1050
|
-
* @param file (String) path of file to load.
|
|
1051
|
-
*/
|
|
1052
|
-
Mime.prototype.load = function (file) {
|
|
1053
|
-
this._loading = file;
|
|
1054
|
-
// Read file and split into lines
|
|
1055
|
-
var map = {},
|
|
1056
|
-
content = fs.readFileSync(file, 'ascii'),
|
|
1057
|
-
lines = content.split(/[\r\n]+/);
|
|
1058
|
-
lines.forEach(function (line) {
|
|
1059
|
-
// Clean up whitespace/comments, and split into fields
|
|
1060
|
-
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);
|
|
1061
|
-
map[fields.shift()] = fields;
|
|
1062
|
-
});
|
|
1063
|
-
this.define(map);
|
|
1064
|
-
this._loading = null;
|
|
1065
|
-
};
|
|
1066
|
-
|
|
1067
|
-
/**
|
|
1068
|
-
* Lookup a mime type based on extension
|
|
1069
|
-
*/
|
|
1070
|
-
Mime.prototype.lookup = function (path, fallback) {
|
|
1071
|
-
var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase();
|
|
1072
|
-
return this.types[ext] || fallback || this.default_type;
|
|
1073
|
-
};
|
|
1074
|
-
|
|
1075
|
-
/**
|
|
1076
|
-
* Return file extension associated with a mime type
|
|
1077
|
-
*/
|
|
1078
|
-
Mime.prototype.extension = function (mimeType) {
|
|
1079
|
-
var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
|
|
1080
|
-
return this.extensions[type];
|
|
1081
|
-
};
|
|
1082
|
-
|
|
1083
|
-
// Default instance
|
|
1084
|
-
var mime = new Mime();
|
|
1085
|
-
|
|
1086
|
-
// Define built-in types
|
|
1087
|
-
mime.define(__webpack_require__(796));
|
|
1088
|
-
|
|
1089
|
-
// Default type
|
|
1090
|
-
mime.default_type = mime.lookup('bin');
|
|
1091
|
-
|
|
1092
|
-
//
|
|
1093
|
-
// Additional API specific to the default instance
|
|
1094
|
-
//
|
|
1095
|
-
|
|
1096
|
-
mime.Mime = Mime;
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* Lookup a charset based on mime type.
|
|
1100
|
-
*/
|
|
1101
|
-
mime.charsets = {
|
|
1102
|
-
lookup: function (mimeType, fallback) {
|
|
1103
|
-
// Assume text types are utf8
|
|
1104
|
-
return /^text\/|^application\/(javascript|json)/.test(mimeType) ? 'UTF-8' : fallback;
|
|
1105
|
-
}
|
|
1106
|
-
};
|
|
1107
|
-
module.exports = mime;
|
|
1108
|
-
|
|
1109
|
-
/***/ }),
|
|
1110
|
-
|
|
1111
|
-
/***/ 278:
|
|
1112
|
-
/***/ ((module) => {
|
|
1113
|
-
|
|
1114
|
-
"use strict";
|
|
1115
|
-
module.exports = require("net");
|
|
1116
|
-
|
|
1117
|
-
/***/ }),
|
|
1118
|
-
|
|
1119
|
-
/***/ 282:
|
|
1120
|
-
/***/ ((module) => {
|
|
1121
|
-
|
|
1122
|
-
"use strict";
|
|
1123
|
-
/*!
|
|
1124
|
-
* toidentifier
|
|
1125
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
1126
|
-
* MIT Licensed
|
|
1127
|
-
*/
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* Module exports.
|
|
1133
|
-
* @public
|
|
1134
|
-
*/
|
|
1135
|
-
module.exports = toIdentifier;
|
|
1136
|
-
|
|
1137
|
-
/**
|
|
1138
|
-
* Trasform the given string into a JavaScript identifier
|
|
1139
|
-
*
|
|
1140
|
-
* @param {string} str
|
|
1141
|
-
* @returns {string}
|
|
1142
|
-
* @public
|
|
1143
|
-
*/
|
|
1144
|
-
|
|
1145
|
-
function toIdentifier(str) {
|
|
1146
|
-
return str.split(' ').map(function (token) {
|
|
1147
|
-
return token.slice(0, 1).toUpperCase() + token.slice(1);
|
|
1148
|
-
}).join('').replace(/[^ _0-9a-z]/gi, '');
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
/***/ }),
|
|
1152
|
-
|
|
1153
|
-
/***/ 289:
|
|
1154
|
-
/***/ ((module) => {
|
|
1155
|
-
|
|
1156
|
-
"use strict";
|
|
1157
|
-
/*!
|
|
1158
|
-
* ee-first
|
|
1159
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
1160
|
-
* MIT Licensed
|
|
1161
|
-
*/
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
/**
|
|
1166
|
-
* Module exports.
|
|
1167
|
-
* @public
|
|
1168
|
-
*/
|
|
1169
|
-
module.exports = first;
|
|
1170
|
-
|
|
1171
|
-
/**
|
|
1172
|
-
* Get the first event in a set of event emitters and event pairs.
|
|
1173
|
-
*
|
|
1174
|
-
* @param {array} stuff
|
|
1175
|
-
* @param {function} done
|
|
1176
|
-
* @public
|
|
1177
|
-
*/
|
|
1178
|
-
|
|
1179
|
-
function first(stuff, done) {
|
|
1180
|
-
if (!Array.isArray(stuff)) throw new TypeError('arg must be an array of [ee, events...] arrays');
|
|
1181
|
-
var cleanups = [];
|
|
1182
|
-
for (var i = 0; i < stuff.length; i++) {
|
|
1183
|
-
var arr = stuff[i];
|
|
1184
|
-
if (!Array.isArray(arr) || arr.length < 2) throw new TypeError('each array member must be [ee, events...]');
|
|
1185
|
-
var ee = arr[0];
|
|
1186
|
-
for (var j = 1; j < arr.length; j++) {
|
|
1187
|
-
var event = arr[j];
|
|
1188
|
-
var fn = listener(event, callback);
|
|
1189
|
-
|
|
1190
|
-
// listen to the event
|
|
1191
|
-
ee.on(event, fn);
|
|
1192
|
-
// push this listener to the list of cleanups
|
|
1193
|
-
cleanups.push({
|
|
1194
|
-
ee: ee,
|
|
1195
|
-
event: event,
|
|
1196
|
-
fn: fn
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
function callback() {
|
|
1201
|
-
cleanup();
|
|
1202
|
-
done.apply(null, arguments);
|
|
1203
|
-
}
|
|
1204
|
-
function cleanup() {
|
|
1205
|
-
var x;
|
|
1206
|
-
for (var i = 0; i < cleanups.length; i++) {
|
|
1207
|
-
x = cleanups[i];
|
|
1208
|
-
x.ee.removeListener(x.event, x.fn);
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
function thunk(fn) {
|
|
1212
|
-
done = fn;
|
|
1213
|
-
}
|
|
1214
|
-
thunk.cancel = cleanup;
|
|
1215
|
-
return thunk;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* Create the event listener.
|
|
1220
|
-
* @private
|
|
1221
|
-
*/
|
|
1222
|
-
|
|
1223
|
-
function listener(event, done) {
|
|
1224
|
-
return function onevent(arg1) {
|
|
1225
|
-
var args = new Array(arguments.length);
|
|
1226
|
-
var ee = this;
|
|
1227
|
-
var err = event === 'error' ? arg1 : null;
|
|
1228
|
-
|
|
1229
|
-
// copy args to prevent arguments escaping scope
|
|
1230
|
-
for (var i = 0; i < args.length; i++) {
|
|
1231
|
-
args[i] = arguments[i];
|
|
1232
|
-
}
|
|
1233
|
-
done(err, ee, event, args);
|
|
1234
|
-
};
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
/***/ }),
|
|
1238
|
-
|
|
1239
|
-
/***/ 290:
|
|
1240
|
-
/***/ ((module) => {
|
|
1241
|
-
|
|
1242
|
-
"use strict";
|
|
1243
|
-
module.exports = require("async_hooks");
|
|
1244
|
-
|
|
1245
|
-
/***/ }),
|
|
1246
|
-
|
|
1247
|
-
/***/ 365:
|
|
1248
|
-
/***/ ((module) => {
|
|
1249
|
-
|
|
1250
|
-
if (typeof Object.create === 'function') {
|
|
1251
|
-
// implementation from standard node.js 'util' module
|
|
1252
|
-
module.exports = function inherits(ctor, superCtor) {
|
|
1253
|
-
if (superCtor) {
|
|
1254
|
-
ctor.super_ = superCtor;
|
|
1255
|
-
ctor.prototype = Object.create(superCtor.prototype, {
|
|
1256
|
-
constructor: {
|
|
1257
|
-
value: ctor,
|
|
1258
|
-
enumerable: false,
|
|
1259
|
-
writable: true,
|
|
1260
|
-
configurable: true
|
|
1261
|
-
}
|
|
1262
|
-
});
|
|
1263
|
-
}
|
|
1264
|
-
};
|
|
1265
|
-
} else {
|
|
1266
|
-
// old school shim for old browsers
|
|
1267
|
-
module.exports = function inherits(ctor, superCtor) {
|
|
1268
|
-
if (superCtor) {
|
|
1269
|
-
ctor.super_ = superCtor;
|
|
1270
|
-
var TempCtor = function () {};
|
|
1271
|
-
TempCtor.prototype = superCtor.prototype;
|
|
1272
|
-
ctor.prototype = new TempCtor();
|
|
1273
|
-
ctor.prototype.constructor = ctor;
|
|
1274
|
-
}
|
|
1275
|
-
};
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
/***/ }),
|
|
1279
|
-
|
|
1280
|
-
/***/ 404:
|
|
1281
|
-
/***/ ((module) => {
|
|
1282
|
-
|
|
1283
|
-
"use strict";
|
|
1284
|
-
module.exports = require("util");
|
|
1285
|
-
|
|
1286
|
-
/***/ }),
|
|
1287
|
-
|
|
1288
|
-
/***/ 415:
|
|
1289
|
-
/***/ ((module) => {
|
|
1290
|
-
|
|
1291
|
-
"use strict";
|
|
1292
|
-
/*!
|
|
1293
|
-
* escape-html
|
|
1294
|
-
* Copyright(c) 2012-2013 TJ Holowaychuk
|
|
1295
|
-
* Copyright(c) 2015 Andreas Lubbe
|
|
1296
|
-
* Copyright(c) 2015 Tiancheng "Timothy" Gu
|
|
1297
|
-
* MIT Licensed
|
|
1298
|
-
*/
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
/**
|
|
1303
|
-
* Module variables.
|
|
1304
|
-
* @private
|
|
1305
|
-
*/
|
|
1306
|
-
var matchHtmlRegExp = /["'&<>]/;
|
|
1307
|
-
|
|
1308
|
-
/**
|
|
1309
|
-
* Module exports.
|
|
1310
|
-
* @public
|
|
1311
|
-
*/
|
|
1312
|
-
|
|
1313
|
-
module.exports = escapeHtml;
|
|
1314
|
-
|
|
1315
|
-
/**
|
|
1316
|
-
* Escape special characters in the given string of html.
|
|
1317
|
-
*
|
|
1318
|
-
* @param {string} string The string to escape for inserting into HTML
|
|
1319
|
-
* @return {string}
|
|
1320
|
-
* @public
|
|
1321
|
-
*/
|
|
1322
|
-
|
|
1323
|
-
function escapeHtml(string) {
|
|
1324
|
-
var str = '' + string;
|
|
1325
|
-
var match = matchHtmlRegExp.exec(str);
|
|
1326
|
-
if (!match) {
|
|
1327
|
-
return str;
|
|
1328
|
-
}
|
|
1329
|
-
var escape;
|
|
1330
|
-
var html = '';
|
|
1331
|
-
var index = 0;
|
|
1332
|
-
var lastIndex = 0;
|
|
1333
|
-
for (index = match.index; index < str.length; index++) {
|
|
1334
|
-
switch (str.charCodeAt(index)) {
|
|
1335
|
-
case 34:
|
|
1336
|
-
// "
|
|
1337
|
-
escape = '"';
|
|
1338
|
-
break;
|
|
1339
|
-
case 38:
|
|
1340
|
-
// &
|
|
1341
|
-
escape = '&';
|
|
1342
|
-
break;
|
|
1343
|
-
case 39:
|
|
1344
|
-
// '
|
|
1345
|
-
escape = ''';
|
|
1346
|
-
break;
|
|
1347
|
-
case 60:
|
|
1348
|
-
// <
|
|
1349
|
-
escape = '<';
|
|
1350
|
-
break;
|
|
1351
|
-
case 62:
|
|
1352
|
-
// >
|
|
1353
|
-
escape = '>';
|
|
1354
|
-
break;
|
|
1355
|
-
default:
|
|
1356
|
-
continue;
|
|
1357
|
-
}
|
|
1358
|
-
if (lastIndex !== index) {
|
|
1359
|
-
html += str.substring(lastIndex, index);
|
|
1360
|
-
}
|
|
1361
|
-
lastIndex = index + 1;
|
|
1362
|
-
html += escape;
|
|
1363
|
-
}
|
|
1364
|
-
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
/***/ }),
|
|
1368
|
-
|
|
1369
|
-
/***/ 420:
|
|
1370
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
1371
|
-
|
|
1372
|
-
"use strict";
|
|
1373
|
-
/*!
|
|
1374
|
-
* on-finished
|
|
1375
|
-
* Copyright(c) 2013 Jonathan Ong
|
|
1376
|
-
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
1377
|
-
* MIT Licensed
|
|
1378
|
-
*/
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
/**
|
|
1383
|
-
* Module exports.
|
|
1384
|
-
* @public
|
|
1385
|
-
*/
|
|
1386
|
-
module.exports = onFinished;
|
|
1387
|
-
module.exports.isFinished = isFinished;
|
|
1388
|
-
|
|
1389
|
-
/**
|
|
1390
|
-
* Module dependencies.
|
|
1391
|
-
* @private
|
|
1392
|
-
*/
|
|
1393
|
-
|
|
1394
|
-
var asyncHooks = tryRequireAsyncHooks();
|
|
1395
|
-
var first = __webpack_require__(289);
|
|
1396
|
-
|
|
1397
|
-
/**
|
|
1398
|
-
* Variables.
|
|
1399
|
-
* @private
|
|
1400
|
-
*/
|
|
1401
|
-
|
|
1402
|
-
/* istanbul ignore next */
|
|
1403
|
-
var defer = typeof setImmediate === 'function' ? setImmediate : function (fn) {
|
|
1404
|
-
process.nextTick(fn.bind.apply(fn, arguments));
|
|
1405
|
-
};
|
|
1406
|
-
|
|
1407
|
-
/**
|
|
1408
|
-
* Invoke callback when the response has finished, useful for
|
|
1409
|
-
* cleaning up resources afterwards.
|
|
1410
|
-
*
|
|
1411
|
-
* @param {object} msg
|
|
1412
|
-
* @param {function} listener
|
|
1413
|
-
* @return {object}
|
|
1414
|
-
* @public
|
|
1415
|
-
*/
|
|
1416
|
-
|
|
1417
|
-
function onFinished(msg, listener) {
|
|
1418
|
-
if (isFinished(msg) !== false) {
|
|
1419
|
-
defer(listener, null, msg);
|
|
1420
|
-
return msg;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
// attach the listener to the message
|
|
1424
|
-
attachListener(msg, wrap(listener));
|
|
1425
|
-
return msg;
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
/**
|
|
1429
|
-
* Determine if message is already finished.
|
|
1430
|
-
*
|
|
1431
|
-
* @param {object} msg
|
|
1432
|
-
* @return {boolean}
|
|
1433
|
-
* @public
|
|
1434
|
-
*/
|
|
1435
|
-
|
|
1436
|
-
function isFinished(msg) {
|
|
1437
|
-
var socket = msg.socket;
|
|
1438
|
-
if (typeof msg.finished === 'boolean') {
|
|
1439
|
-
// OutgoingMessage
|
|
1440
|
-
return Boolean(msg.finished || socket && !socket.writable);
|
|
1441
|
-
}
|
|
1442
|
-
if (typeof msg.complete === 'boolean') {
|
|
1443
|
-
// IncomingMessage
|
|
1444
|
-
return Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable);
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
// don't know
|
|
1448
|
-
return undefined;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
/**
|
|
1452
|
-
* Attach a finished listener to the message.
|
|
1453
|
-
*
|
|
1454
|
-
* @param {object} msg
|
|
1455
|
-
* @param {function} callback
|
|
1456
|
-
* @private
|
|
1457
|
-
*/
|
|
1458
|
-
|
|
1459
|
-
function attachFinishedListener(msg, callback) {
|
|
1460
|
-
var eeMsg;
|
|
1461
|
-
var eeSocket;
|
|
1462
|
-
var finished = false;
|
|
1463
|
-
function onFinish(error) {
|
|
1464
|
-
eeMsg.cancel();
|
|
1465
|
-
eeSocket.cancel();
|
|
1466
|
-
finished = true;
|
|
1467
|
-
callback(error);
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
// finished on first message event
|
|
1471
|
-
eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish);
|
|
1472
|
-
function onSocket(socket) {
|
|
1473
|
-
// remove listener
|
|
1474
|
-
msg.removeListener('socket', onSocket);
|
|
1475
|
-
if (finished) return;
|
|
1476
|
-
if (eeMsg !== eeSocket) return;
|
|
1477
|
-
|
|
1478
|
-
// finished on first socket event
|
|
1479
|
-
eeSocket = first([[socket, 'error', 'close']], onFinish);
|
|
1480
|
-
}
|
|
1481
|
-
if (msg.socket) {
|
|
1482
|
-
// socket already assigned
|
|
1483
|
-
onSocket(msg.socket);
|
|
1484
|
-
return;
|
|
1485
|
-
}
|
|
1486
|
-
|
|
1487
|
-
// wait for socket to be assigned
|
|
1488
|
-
msg.on('socket', onSocket);
|
|
1489
|
-
if (msg.socket === undefined) {
|
|
1490
|
-
// istanbul ignore next: node.js 0.8 patch
|
|
1491
|
-
patchAssignSocket(msg, onSocket);
|
|
1492
|
-
}
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
* Attach the listener to the message.
|
|
1497
|
-
*
|
|
1498
|
-
* @param {object} msg
|
|
1499
|
-
* @return {function}
|
|
1500
|
-
* @private
|
|
1501
|
-
*/
|
|
1502
|
-
|
|
1503
|
-
function attachListener(msg, listener) {
|
|
1504
|
-
var attached = msg.__onFinished;
|
|
1505
|
-
|
|
1506
|
-
// create a private single listener with queue
|
|
1507
|
-
if (!attached || !attached.queue) {
|
|
1508
|
-
attached = msg.__onFinished = createListener(msg);
|
|
1509
|
-
attachFinishedListener(msg, attached);
|
|
1510
|
-
}
|
|
1511
|
-
attached.queue.push(listener);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
/**
|
|
1515
|
-
* Create listener on message.
|
|
1516
|
-
*
|
|
1517
|
-
* @param {object} msg
|
|
1518
|
-
* @return {function}
|
|
1519
|
-
* @private
|
|
1520
|
-
*/
|
|
1521
|
-
|
|
1522
|
-
function createListener(msg) {
|
|
1523
|
-
function listener(err) {
|
|
1524
|
-
if (msg.__onFinished === listener) msg.__onFinished = null;
|
|
1525
|
-
if (!listener.queue) return;
|
|
1526
|
-
var queue = listener.queue;
|
|
1527
|
-
listener.queue = null;
|
|
1528
|
-
for (var i = 0; i < queue.length; i++) {
|
|
1529
|
-
queue[i](err, msg);
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
listener.queue = [];
|
|
1533
|
-
return listener;
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
/**
|
|
1537
|
-
* Patch ServerResponse.prototype.assignSocket for node.js 0.8.
|
|
1538
|
-
*
|
|
1539
|
-
* @param {ServerResponse} res
|
|
1540
|
-
* @param {function} callback
|
|
1541
|
-
* @private
|
|
1542
|
-
*/
|
|
1543
|
-
|
|
1544
|
-
// istanbul ignore next: node.js 0.8 patch
|
|
1545
|
-
function patchAssignSocket(res, callback) {
|
|
1546
|
-
var assignSocket = res.assignSocket;
|
|
1547
|
-
if (typeof assignSocket !== 'function') return;
|
|
1548
|
-
|
|
1549
|
-
// res.on('socket', callback) is broken in 0.8
|
|
1550
|
-
res.assignSocket = function _assignSocket(socket) {
|
|
1551
|
-
assignSocket.call(this, socket);
|
|
1552
|
-
callback(socket);
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* Try to require async_hooks
|
|
1558
|
-
* @private
|
|
1559
|
-
*/
|
|
1560
|
-
|
|
1561
|
-
function tryRequireAsyncHooks() {
|
|
1562
|
-
try {
|
|
1563
|
-
return __webpack_require__(290);
|
|
1564
|
-
} catch (e) {
|
|
1565
|
-
return {};
|
|
1566
|
-
}
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
/**
|
|
1570
|
-
* Wrap function with async resource, if possible.
|
|
1571
|
-
* AsyncResource.bind static method backported.
|
|
1572
|
-
* @private
|
|
1573
|
-
*/
|
|
1574
|
-
|
|
1575
|
-
function wrap(fn) {
|
|
1576
|
-
var res;
|
|
1577
|
-
|
|
1578
|
-
// create anonymous resource
|
|
1579
|
-
if (asyncHooks.AsyncResource) {
|
|
1580
|
-
res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn');
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
// incompatible node.js
|
|
1584
|
-
if (!res || !res.runInAsyncScope) {
|
|
1585
|
-
return fn;
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
// return bound function
|
|
1589
|
-
return res.runInAsyncScope.bind(res, fn, null);
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
/***/ }),
|
|
1593
|
-
|
|
1594
|
-
/***/ 434:
|
|
1595
|
-
/***/ ((module) => {
|
|
1596
|
-
|
|
1597
|
-
"use strict";
|
|
1598
|
-
module.exports = require("events");
|
|
1599
|
-
|
|
1600
|
-
/***/ }),
|
|
1601
|
-
|
|
1602
|
-
/***/ 479:
|
|
1603
|
-
/***/ ((module) => {
|
|
1604
|
-
|
|
1605
|
-
"use strict";
|
|
1606
|
-
/*!
|
|
1607
|
-
* range-parser
|
|
1608
|
-
* Copyright(c) 2012-2014 TJ Holowaychuk
|
|
1609
|
-
* Copyright(c) 2015-2016 Douglas Christopher Wilson
|
|
1610
|
-
* MIT Licensed
|
|
1611
|
-
*/
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
/**
|
|
1616
|
-
* Module exports.
|
|
1617
|
-
* @public
|
|
1618
|
-
*/
|
|
1619
|
-
module.exports = rangeParser;
|
|
1620
|
-
|
|
1621
|
-
/**
|
|
1622
|
-
* Parse "Range" header `str` relative to the given file `size`.
|
|
1623
|
-
*
|
|
1624
|
-
* @param {Number} size
|
|
1625
|
-
* @param {String} str
|
|
1626
|
-
* @param {Object} [options]
|
|
1627
|
-
* @return {Array}
|
|
1628
|
-
* @public
|
|
1629
|
-
*/
|
|
1630
|
-
|
|
1631
|
-
function rangeParser(size, str, options) {
|
|
1632
|
-
if (typeof str !== 'string') {
|
|
1633
|
-
throw new TypeError('argument str must be a string');
|
|
1634
|
-
}
|
|
1635
|
-
var index = str.indexOf('=');
|
|
1636
|
-
if (index === -1) {
|
|
1637
|
-
return -2;
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
// split the range string
|
|
1641
|
-
var arr = str.slice(index + 1).split(',');
|
|
1642
|
-
var ranges = [];
|
|
1643
|
-
|
|
1644
|
-
// add ranges type
|
|
1645
|
-
ranges.type = str.slice(0, index);
|
|
1646
|
-
|
|
1647
|
-
// parse all ranges
|
|
1648
|
-
for (var i = 0; i < arr.length; i++) {
|
|
1649
|
-
var range = arr[i].split('-');
|
|
1650
|
-
var start = parseInt(range[0], 10);
|
|
1651
|
-
var end = parseInt(range[1], 10);
|
|
1652
|
-
|
|
1653
|
-
// -nnn
|
|
1654
|
-
if (isNaN(start)) {
|
|
1655
|
-
start = size - end;
|
|
1656
|
-
end = size - 1;
|
|
1657
|
-
// nnn-
|
|
1658
|
-
} else if (isNaN(end)) {
|
|
1659
|
-
end = size - 1;
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
// limit last-byte-pos to current length
|
|
1663
|
-
if (end > size - 1) {
|
|
1664
|
-
end = size - 1;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
// invalid or unsatisifiable
|
|
1668
|
-
if (isNaN(start) || isNaN(end) || start > end || start < 0) {
|
|
1669
|
-
continue;
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
// add range
|
|
1673
|
-
ranges.push({
|
|
1674
|
-
start: start,
|
|
1675
|
-
end: end
|
|
1676
|
-
});
|
|
1677
|
-
}
|
|
1678
|
-
if (ranges.length < 1) {
|
|
1679
|
-
// unsatisifiable
|
|
1680
|
-
return -1;
|
|
1681
|
-
}
|
|
1682
|
-
return options && options.combine ? combineRanges(ranges) : ranges;
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
/**
|
|
1686
|
-
* Combine overlapping & adjacent ranges.
|
|
1687
|
-
* @private
|
|
1688
|
-
*/
|
|
1689
|
-
|
|
1690
|
-
function combineRanges(ranges) {
|
|
1691
|
-
var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart);
|
|
1692
|
-
for (var j = 0, i = 1; i < ordered.length; i++) {
|
|
1693
|
-
var range = ordered[i];
|
|
1694
|
-
var current = ordered[j];
|
|
1695
|
-
if (range.start > current.end + 1) {
|
|
1696
|
-
// next range
|
|
1697
|
-
ordered[++j] = range;
|
|
1698
|
-
} else if (range.end > current.end) {
|
|
1699
|
-
// extend range
|
|
1700
|
-
current.end = range.end;
|
|
1701
|
-
current.index = Math.min(current.index, range.index);
|
|
1702
|
-
}
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
// trim ordered array
|
|
1706
|
-
ordered.length = j + 1;
|
|
1707
|
-
|
|
1708
|
-
// generate combined range
|
|
1709
|
-
var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex);
|
|
1710
|
-
|
|
1711
|
-
// copy ranges type
|
|
1712
|
-
combined.type = ranges.type;
|
|
1713
|
-
return combined;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
/**
|
|
1717
|
-
* Map function to add index value to ranges.
|
|
1718
|
-
* @private
|
|
1719
|
-
*/
|
|
1720
|
-
|
|
1721
|
-
function mapWithIndex(range, index) {
|
|
1722
|
-
return {
|
|
1723
|
-
start: range.start,
|
|
1724
|
-
end: range.end,
|
|
1725
|
-
index: index
|
|
1726
|
-
};
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Map function to remove index value from ranges.
|
|
1731
|
-
* @private
|
|
1732
|
-
*/
|
|
1733
|
-
|
|
1734
|
-
function mapWithoutIndex(range) {
|
|
1735
|
-
return {
|
|
1736
|
-
start: range.start,
|
|
1737
|
-
end: range.end
|
|
1738
|
-
};
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
/**
|
|
1742
|
-
* Sort function to sort ranges by index.
|
|
1743
|
-
* @private
|
|
1744
|
-
*/
|
|
1745
|
-
|
|
1746
|
-
function sortByRangeIndex(a, b) {
|
|
1747
|
-
return a.index - b.index;
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
/**
|
|
1751
|
-
* Sort function to sort ranges by start position.
|
|
1752
|
-
* @private
|
|
1753
|
-
*/
|
|
1754
|
-
|
|
1755
|
-
function sortByRangeStart(a, b) {
|
|
1756
|
-
return a.start - b.start;
|
|
1757
|
-
}
|
|
1758
|
-
|
|
1759
|
-
/***/ }),
|
|
1760
|
-
|
|
1761
|
-
/***/ 480:
|
|
1762
|
-
/***/ ((module) => {
|
|
1763
|
-
|
|
1764
|
-
"use strict";
|
|
1765
|
-
/*!
|
|
1766
|
-
* fresh
|
|
1767
|
-
* Copyright(c) 2012 TJ Holowaychuk
|
|
1768
|
-
* Copyright(c) 2016-2017 Douglas Christopher Wilson
|
|
1769
|
-
* MIT Licensed
|
|
1770
|
-
*/
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
/**
|
|
1775
|
-
* RegExp to check for no-cache token in Cache-Control.
|
|
1776
|
-
* @private
|
|
1777
|
-
*/
|
|
1778
|
-
var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/;
|
|
1779
|
-
|
|
1780
|
-
/**
|
|
1781
|
-
* Module exports.
|
|
1782
|
-
* @public
|
|
1783
|
-
*/
|
|
1784
|
-
|
|
1785
|
-
module.exports = fresh;
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* Check freshness of the response using request and response headers.
|
|
1789
|
-
*
|
|
1790
|
-
* @param {Object} reqHeaders
|
|
1791
|
-
* @param {Object} resHeaders
|
|
1792
|
-
* @return {Boolean}
|
|
1793
|
-
* @public
|
|
1794
|
-
*/
|
|
1795
|
-
|
|
1796
|
-
function fresh(reqHeaders, resHeaders) {
|
|
1797
|
-
// fields
|
|
1798
|
-
var modifiedSince = reqHeaders['if-modified-since'];
|
|
1799
|
-
var noneMatch = reqHeaders['if-none-match'];
|
|
1800
|
-
|
|
1801
|
-
// unconditional request
|
|
1802
|
-
if (!modifiedSince && !noneMatch) {
|
|
1803
|
-
return false;
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
// Always return stale when Cache-Control: no-cache
|
|
1807
|
-
// to support end-to-end reload requests
|
|
1808
|
-
// https://tools.ietf.org/html/rfc2616#section-14.9.4
|
|
1809
|
-
var cacheControl = reqHeaders['cache-control'];
|
|
1810
|
-
if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) {
|
|
1811
|
-
return false;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
// if-none-match
|
|
1815
|
-
if (noneMatch && noneMatch !== '*') {
|
|
1816
|
-
var etag = resHeaders['etag'];
|
|
1817
|
-
if (!etag) {
|
|
1818
|
-
return false;
|
|
1819
|
-
}
|
|
1820
|
-
var etagStale = true;
|
|
1821
|
-
var matches = parseTokenList(noneMatch);
|
|
1822
|
-
for (var i = 0; i < matches.length; i++) {
|
|
1823
|
-
var match = matches[i];
|
|
1824
|
-
if (match === etag || match === 'W/' + etag || 'W/' + match === etag) {
|
|
1825
|
-
etagStale = false;
|
|
1826
|
-
break;
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
if (etagStale) {
|
|
1830
|
-
return false;
|
|
1831
|
-
}
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
// if-modified-since
|
|
1835
|
-
if (modifiedSince) {
|
|
1836
|
-
var lastModified = resHeaders['last-modified'];
|
|
1837
|
-
var modifiedStale = !lastModified || !(parseHttpDate(lastModified) <= parseHttpDate(modifiedSince));
|
|
1838
|
-
if (modifiedStale) {
|
|
1839
|
-
return false;
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
return true;
|
|
1843
|
-
}
|
|
1844
|
-
|
|
1845
|
-
/**
|
|
1846
|
-
* Parse an HTTP Date into a number.
|
|
1847
|
-
*
|
|
1848
|
-
* @param {string} date
|
|
1849
|
-
* @private
|
|
1850
|
-
*/
|
|
1851
|
-
|
|
1852
|
-
function parseHttpDate(date) {
|
|
1853
|
-
var timestamp = date && Date.parse(date);
|
|
1854
|
-
|
|
1855
|
-
// istanbul ignore next: guard against date.js Date.parse patching
|
|
1856
|
-
return typeof timestamp === 'number' ? timestamp : NaN;
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
/**
|
|
1860
|
-
* Parse a HTTP token list.
|
|
1861
|
-
*
|
|
1862
|
-
* @param {string} str
|
|
1863
|
-
* @private
|
|
1864
|
-
*/
|
|
1865
|
-
|
|
1866
|
-
function parseTokenList(str) {
|
|
1867
|
-
var end = 0;
|
|
1868
|
-
var list = [];
|
|
1869
|
-
var start = 0;
|
|
1870
|
-
|
|
1871
|
-
// gather tokens
|
|
1872
|
-
for (var i = 0, len = str.length; i < len; i++) {
|
|
1873
|
-
switch (str.charCodeAt(i)) {
|
|
1874
|
-
case 0x20:
|
|
1875
|
-
/* */
|
|
1876
|
-
if (start === end) {
|
|
1877
|
-
start = end = i + 1;
|
|
1878
|
-
}
|
|
1879
|
-
break;
|
|
1880
|
-
case 0x2c:
|
|
1881
|
-
/* , */
|
|
1882
|
-
list.push(str.substring(start, end));
|
|
1883
|
-
start = end = i + 1;
|
|
1884
|
-
break;
|
|
1885
|
-
default:
|
|
1886
|
-
end = i + 1;
|
|
1887
|
-
break;
|
|
1888
|
-
}
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
// final token
|
|
1892
|
-
list.push(str.substring(start, end));
|
|
1893
|
-
return list;
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
|
-
/***/ }),
|
|
1897
|
-
|
|
1898
|
-
/***/ 498:
|
|
1899
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
1900
|
-
|
|
1901
|
-
/**
|
|
1902
|
-
* Module dependencies.
|
|
1903
|
-
*/
|
|
1904
|
-
|
|
1905
|
-
var tty = __webpack_require__(18);
|
|
1906
|
-
var util = __webpack_require__(404);
|
|
1907
|
-
|
|
1908
|
-
/**
|
|
1909
|
-
* This is the Node.js implementation of `debug()`.
|
|
1910
|
-
*
|
|
1911
|
-
* Expose `debug()` as the module.
|
|
1912
|
-
*/
|
|
1913
|
-
|
|
1914
|
-
exports = module.exports = __webpack_require__(843);
|
|
1915
|
-
exports.init = init;
|
|
1916
|
-
exports.log = log;
|
|
1917
|
-
exports.formatArgs = formatArgs;
|
|
1918
|
-
exports.save = save;
|
|
1919
|
-
exports.load = load;
|
|
1920
|
-
exports.useColors = useColors;
|
|
1921
|
-
|
|
1922
|
-
/**
|
|
1923
|
-
* Colors.
|
|
1924
|
-
*/
|
|
1925
|
-
|
|
1926
|
-
exports.colors = [6, 2, 3, 4, 5, 1];
|
|
1927
|
-
|
|
1928
|
-
/**
|
|
1929
|
-
* Build up the default `inspectOpts` object from the environment variables.
|
|
1930
|
-
*
|
|
1931
|
-
* $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
|
|
1932
|
-
*/
|
|
1933
|
-
|
|
1934
|
-
exports.inspectOpts = Object.keys(process.env).filter(function (key) {
|
|
1935
|
-
return /^debug_/i.test(key);
|
|
1936
|
-
}).reduce(function (obj, key) {
|
|
1937
|
-
// camel-case
|
|
1938
|
-
var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {
|
|
1939
|
-
return k.toUpperCase();
|
|
1940
|
-
});
|
|
1941
|
-
|
|
1942
|
-
// coerce string value into JS value
|
|
1943
|
-
var val = process.env[key];
|
|
1944
|
-
if (/^(yes|on|true|enabled)$/i.test(val)) val = true;else if (/^(no|off|false|disabled)$/i.test(val)) val = false;else if (val === 'null') val = null;else val = Number(val);
|
|
1945
|
-
obj[prop] = val;
|
|
1946
|
-
return obj;
|
|
1947
|
-
}, {});
|
|
1948
|
-
|
|
1949
|
-
/**
|
|
1950
|
-
* The file descriptor to write the `debug()` calls to.
|
|
1951
|
-
* Set the `DEBUG_FD` env variable to override with another value. i.e.:
|
|
1952
|
-
*
|
|
1953
|
-
* $ DEBUG_FD=3 node script.js 3>debug.log
|
|
1954
|
-
*/
|
|
1955
|
-
|
|
1956
|
-
var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
|
|
1957
|
-
if (1 !== fd && 2 !== fd) {
|
|
1958
|
-
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)')();
|
|
1959
|
-
}
|
|
1960
|
-
var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
|
|
1961
|
-
|
|
1962
|
-
/**
|
|
1963
|
-
* Is stdout a TTY? Colored output is enabled when `true`.
|
|
1964
|
-
*/
|
|
1965
|
-
|
|
1966
|
-
function useColors() {
|
|
1967
|
-
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(fd);
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
/**
|
|
1971
|
-
* Map %o to `util.inspect()`, all on a single line.
|
|
1972
|
-
*/
|
|
1973
|
-
|
|
1974
|
-
exports.formatters.o = function (v) {
|
|
1975
|
-
this.inspectOpts.colors = this.useColors;
|
|
1976
|
-
return util.inspect(v, this.inspectOpts).split('\n').map(function (str) {
|
|
1977
|
-
return str.trim();
|
|
1978
|
-
}).join(' ');
|
|
1979
|
-
};
|
|
1980
|
-
|
|
1981
|
-
/**
|
|
1982
|
-
* Map %o to `util.inspect()`, allowing multiple lines if needed.
|
|
1983
|
-
*/
|
|
1984
|
-
|
|
1985
|
-
exports.formatters.O = function (v) {
|
|
1986
|
-
this.inspectOpts.colors = this.useColors;
|
|
1987
|
-
return util.inspect(v, this.inspectOpts);
|
|
1988
|
-
};
|
|
1989
|
-
|
|
1990
|
-
/**
|
|
1991
|
-
* Adds ANSI color escape codes if enabled.
|
|
1992
|
-
*
|
|
1993
|
-
* @api public
|
|
1994
|
-
*/
|
|
1995
|
-
|
|
1996
|
-
function formatArgs(args) {
|
|
1997
|
-
var name = this.namespace;
|
|
1998
|
-
var useColors = this.useColors;
|
|
1999
|
-
if (useColors) {
|
|
2000
|
-
var c = this.color;
|
|
2001
|
-
var prefix = ' \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
|
|
2002
|
-
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
2003
|
-
args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
|
|
2004
|
-
} else {
|
|
2005
|
-
args[0] = new Date().toUTCString() + ' ' + name + ' ' + args[0];
|
|
2006
|
-
}
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
|
-
/**
|
|
2010
|
-
* Invokes `util.format()` with the specified arguments and writes to `stream`.
|
|
2011
|
-
*/
|
|
2012
|
-
|
|
2013
|
-
function log() {
|
|
2014
|
-
return stream.write(util.format.apply(util, arguments) + '\n');
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
/**
|
|
2018
|
-
* Save `namespaces`.
|
|
2019
|
-
*
|
|
2020
|
-
* @param {String} namespaces
|
|
2021
|
-
* @api private
|
|
2022
|
-
*/
|
|
2023
|
-
|
|
2024
|
-
function save(namespaces) {
|
|
2025
|
-
if (null == namespaces) {
|
|
2026
|
-
// If you set a process.env field to null or undefined, it gets cast to the
|
|
2027
|
-
// string 'null' or 'undefined'. Just delete instead.
|
|
2028
|
-
delete process.env.DEBUG;
|
|
2029
|
-
} else {
|
|
2030
|
-
process.env.DEBUG = namespaces;
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
/**
|
|
2035
|
-
* Load `namespaces`.
|
|
2036
|
-
*
|
|
2037
|
-
* @return {String} returns the previously persisted debug modes
|
|
2038
|
-
* @api private
|
|
2039
|
-
*/
|
|
2040
|
-
|
|
2041
|
-
function load() {
|
|
2042
|
-
return process.env.DEBUG;
|
|
2043
|
-
}
|
|
2044
|
-
|
|
2045
|
-
/**
|
|
2046
|
-
* Copied from `node/src/node.js`.
|
|
2047
|
-
*
|
|
2048
|
-
* XXX: It's lame that node doesn't expose this API out-of-the-box. It also
|
|
2049
|
-
* relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
|
|
2050
|
-
*/
|
|
2051
|
-
|
|
2052
|
-
function createWritableStdioStream(fd) {
|
|
2053
|
-
var stream;
|
|
2054
|
-
var tty_wrap = process.binding('tty_wrap');
|
|
2055
|
-
|
|
2056
|
-
// Note stream._type is used for test-module-load-list.js
|
|
2057
|
-
|
|
2058
|
-
switch (tty_wrap.guessHandleType(fd)) {
|
|
2059
|
-
case 'TTY':
|
|
2060
|
-
stream = new tty.WriteStream(fd);
|
|
2061
|
-
stream._type = 'tty';
|
|
2062
|
-
|
|
2063
|
-
// Hack to have stream not keep the event loop alive.
|
|
2064
|
-
// See https://github.com/joyent/node/issues/1726
|
|
2065
|
-
if (stream._handle && stream._handle.unref) {
|
|
2066
|
-
stream._handle.unref();
|
|
2067
|
-
}
|
|
2068
|
-
break;
|
|
2069
|
-
case 'FILE':
|
|
2070
|
-
var fs = __webpack_require__(896);
|
|
2071
|
-
stream = new fs.SyncWriteStream(fd, {
|
|
2072
|
-
autoClose: false
|
|
2073
|
-
});
|
|
2074
|
-
stream._type = 'fs';
|
|
2075
|
-
break;
|
|
2076
|
-
case 'PIPE':
|
|
2077
|
-
case 'TCP':
|
|
2078
|
-
var net = __webpack_require__(278);
|
|
2079
|
-
stream = new net.Socket({
|
|
2080
|
-
fd: fd,
|
|
2081
|
-
readable: false,
|
|
2082
|
-
writable: true
|
|
2083
|
-
});
|
|
2084
|
-
|
|
2085
|
-
// FIXME Should probably have an option in net.Socket to create a
|
|
2086
|
-
// stream from an existing fd which is writable only. But for now
|
|
2087
|
-
// we'll just add this hack and set the `readable` member to false.
|
|
2088
|
-
// Test: ./node test/fixtures/echo.js < /etc/passwd
|
|
2089
|
-
stream.readable = false;
|
|
2090
|
-
stream.read = null;
|
|
2091
|
-
stream._type = 'pipe';
|
|
2092
|
-
|
|
2093
|
-
// FIXME Hack to have stream not keep the event loop alive.
|
|
2094
|
-
// See https://github.com/joyent/node/issues/1726
|
|
2095
|
-
if (stream._handle && stream._handle.unref) {
|
|
2096
|
-
stream._handle.unref();
|
|
2097
|
-
}
|
|
2098
|
-
break;
|
|
2099
|
-
default:
|
|
2100
|
-
// Probably an error on in uv_guess_handle()
|
|
2101
|
-
throw new Error('Implement me. Unknown stream file type!');
|
|
2102
|
-
}
|
|
2103
|
-
|
|
2104
|
-
// For supporting legacy API we put the FD here.
|
|
2105
|
-
stream.fd = fd;
|
|
2106
|
-
stream._isStdio = true;
|
|
2107
|
-
return stream;
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
/**
|
|
2111
|
-
* Init logic for `debug` instances.
|
|
2112
|
-
*
|
|
2113
|
-
* Create a new `inspectOpts` object in case `useColors` is set
|
|
2114
|
-
* differently for a particular `debug` instance.
|
|
2115
|
-
*/
|
|
2116
|
-
|
|
2117
|
-
function init(debug) {
|
|
2118
|
-
debug.inspectOpts = {};
|
|
2119
|
-
var keys = Object.keys(exports.inspectOpts);
|
|
2120
|
-
for (var i = 0; i < keys.length; i++) {
|
|
2121
|
-
debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
2122
|
-
}
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
/**
|
|
2126
|
-
* Enable namespaces listed in `process.env.DEBUG` initially.
|
|
2127
|
-
*/
|
|
2128
|
-
|
|
2129
|
-
exports.enable(load());
|
|
2130
|
-
|
|
2131
|
-
/***/ }),
|
|
2132
|
-
|
|
2133
|
-
/***/ 637:
|
|
2134
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2135
|
-
|
|
2136
|
-
"use strict";
|
|
2137
|
-
/*!
|
|
2138
|
-
* destroy
|
|
2139
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
2140
|
-
* Copyright(c) 2015-2022 Douglas Christopher Wilson
|
|
2141
|
-
* MIT Licensed
|
|
2142
|
-
*/
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
/**
|
|
2147
|
-
* Module dependencies.
|
|
2148
|
-
* @private
|
|
2149
|
-
*/
|
|
2150
|
-
var EventEmitter = (__webpack_require__(434).EventEmitter);
|
|
2151
|
-
var ReadStream = (__webpack_require__(896).ReadStream);
|
|
2152
|
-
var Stream = __webpack_require__(203);
|
|
2153
|
-
var Zlib = __webpack_require__(106);
|
|
2154
|
-
|
|
2155
|
-
/**
|
|
2156
|
-
* Module exports.
|
|
2157
|
-
* @public
|
|
2158
|
-
*/
|
|
2159
|
-
|
|
2160
|
-
module.exports = destroy;
|
|
2161
|
-
|
|
2162
|
-
/**
|
|
2163
|
-
* Destroy the given stream, and optionally suppress any future `error` events.
|
|
2164
|
-
*
|
|
2165
|
-
* @param {object} stream
|
|
2166
|
-
* @param {boolean} suppress
|
|
2167
|
-
* @public
|
|
2168
|
-
*/
|
|
2169
|
-
|
|
2170
|
-
function destroy(stream, suppress) {
|
|
2171
|
-
if (isFsReadStream(stream)) {
|
|
2172
|
-
destroyReadStream(stream);
|
|
2173
|
-
} else if (isZlibStream(stream)) {
|
|
2174
|
-
destroyZlibStream(stream);
|
|
2175
|
-
} else if (hasDestroy(stream)) {
|
|
2176
|
-
stream.destroy();
|
|
2177
|
-
}
|
|
2178
|
-
if (isEventEmitter(stream) && suppress) {
|
|
2179
|
-
stream.removeAllListeners('error');
|
|
2180
|
-
stream.addListener('error', noop);
|
|
2181
|
-
}
|
|
2182
|
-
return stream;
|
|
2183
|
-
}
|
|
2184
|
-
|
|
2185
|
-
/**
|
|
2186
|
-
* Destroy a ReadStream.
|
|
2187
|
-
*
|
|
2188
|
-
* @param {object} stream
|
|
2189
|
-
* @private
|
|
2190
|
-
*/
|
|
2191
|
-
|
|
2192
|
-
function destroyReadStream(stream) {
|
|
2193
|
-
stream.destroy();
|
|
2194
|
-
if (typeof stream.close === 'function') {
|
|
2195
|
-
// node.js core bug work-around
|
|
2196
|
-
stream.on('open', onOpenClose);
|
|
2197
|
-
}
|
|
2198
|
-
}
|
|
2199
|
-
|
|
2200
|
-
/**
|
|
2201
|
-
* Close a Zlib stream.
|
|
2202
|
-
*
|
|
2203
|
-
* Zlib streams below Node.js 4.5.5 have a buggy implementation
|
|
2204
|
-
* of .close() when zlib encountered an error.
|
|
2205
|
-
*
|
|
2206
|
-
* @param {object} stream
|
|
2207
|
-
* @private
|
|
2208
|
-
*/
|
|
2209
|
-
|
|
2210
|
-
function closeZlibStream(stream) {
|
|
2211
|
-
if (stream._hadError === true) {
|
|
2212
|
-
var prop = stream._binding === null ? '_binding' : '_handle';
|
|
2213
|
-
stream[prop] = {
|
|
2214
|
-
close: function () {
|
|
2215
|
-
this[prop] = null;
|
|
2216
|
-
}
|
|
2217
|
-
};
|
|
2218
|
-
}
|
|
2219
|
-
stream.close();
|
|
2220
|
-
}
|
|
2221
|
-
|
|
2222
|
-
/**
|
|
2223
|
-
* Destroy a Zlib stream.
|
|
2224
|
-
*
|
|
2225
|
-
* Zlib streams don't have a destroy function in Node.js 6. On top of that
|
|
2226
|
-
* simply calling destroy on a zlib stream in Node.js 8+ will result in a
|
|
2227
|
-
* memory leak. So until that is fixed, we need to call both close AND destroy.
|
|
2228
|
-
*
|
|
2229
|
-
* PR to fix memory leak: https://github.com/nodejs/node/pull/23734
|
|
2230
|
-
*
|
|
2231
|
-
* In Node.js 6+8, it's important that destroy is called before close as the
|
|
2232
|
-
* stream would otherwise emit the error 'zlib binding closed'.
|
|
2233
|
-
*
|
|
2234
|
-
* @param {object} stream
|
|
2235
|
-
* @private
|
|
2236
|
-
*/
|
|
2237
|
-
|
|
2238
|
-
function destroyZlibStream(stream) {
|
|
2239
|
-
if (typeof stream.destroy === 'function') {
|
|
2240
|
-
// node.js core bug work-around
|
|
2241
|
-
// istanbul ignore if: node.js 0.8
|
|
2242
|
-
if (stream._binding) {
|
|
2243
|
-
// node.js < 0.10.0
|
|
2244
|
-
stream.destroy();
|
|
2245
|
-
if (stream._processing) {
|
|
2246
|
-
stream._needDrain = true;
|
|
2247
|
-
stream.once('drain', onDrainClearBinding);
|
|
2248
|
-
} else {
|
|
2249
|
-
stream._binding.clear();
|
|
2250
|
-
}
|
|
2251
|
-
} else if (stream._destroy && stream._destroy !== Stream.Transform.prototype._destroy) {
|
|
2252
|
-
// node.js >= 12, ^11.1.0, ^10.15.1
|
|
2253
|
-
stream.destroy();
|
|
2254
|
-
} else if (stream._destroy && typeof stream.close === 'function') {
|
|
2255
|
-
// node.js 7, 8
|
|
2256
|
-
stream.destroyed = true;
|
|
2257
|
-
stream.close();
|
|
2258
|
-
} else {
|
|
2259
|
-
// fallback
|
|
2260
|
-
// istanbul ignore next
|
|
2261
|
-
stream.destroy();
|
|
2262
|
-
}
|
|
2263
|
-
} else if (typeof stream.close === 'function') {
|
|
2264
|
-
// node.js < 8 fallback
|
|
2265
|
-
closeZlibStream(stream);
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
/**
|
|
2270
|
-
* Determine if stream has destroy.
|
|
2271
|
-
* @private
|
|
2272
|
-
*/
|
|
2273
|
-
|
|
2274
|
-
function hasDestroy(stream) {
|
|
2275
|
-
return stream instanceof Stream && typeof stream.destroy === 'function';
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
/**
|
|
2279
|
-
* Determine if val is EventEmitter.
|
|
2280
|
-
* @private
|
|
2281
|
-
*/
|
|
2282
|
-
|
|
2283
|
-
function isEventEmitter(val) {
|
|
2284
|
-
return val instanceof EventEmitter;
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
/**
|
|
2288
|
-
* Determine if stream is fs.ReadStream stream.
|
|
2289
|
-
* @private
|
|
2290
|
-
*/
|
|
2291
|
-
|
|
2292
|
-
function isFsReadStream(stream) {
|
|
2293
|
-
return stream instanceof ReadStream;
|
|
2294
|
-
}
|
|
2295
|
-
|
|
2296
|
-
/**
|
|
2297
|
-
* Determine if stream is Zlib stream.
|
|
2298
|
-
* @private
|
|
2299
|
-
*/
|
|
2300
|
-
|
|
2301
|
-
function isZlibStream(stream) {
|
|
2302
|
-
return stream instanceof Zlib.Gzip || stream instanceof Zlib.Gunzip || stream instanceof Zlib.Deflate || stream instanceof Zlib.DeflateRaw || stream instanceof Zlib.Inflate || stream instanceof Zlib.InflateRaw || stream instanceof Zlib.Unzip;
|
|
2303
|
-
}
|
|
2304
|
-
|
|
2305
|
-
/**
|
|
2306
|
-
* No-op function.
|
|
2307
|
-
* @private
|
|
2308
|
-
*/
|
|
2309
|
-
|
|
2310
|
-
function noop() {}
|
|
2311
|
-
|
|
2312
|
-
/**
|
|
2313
|
-
* On drain handler to clear binding.
|
|
2314
|
-
* @private
|
|
2315
|
-
*/
|
|
2316
|
-
|
|
2317
|
-
// istanbul ignore next: node.js 0.8
|
|
2318
|
-
function onDrainClearBinding() {
|
|
2319
|
-
this._binding.clear();
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
/**
|
|
2323
|
-
* On open handler to close stream.
|
|
2324
|
-
* @private
|
|
2325
|
-
*/
|
|
2326
|
-
|
|
2327
|
-
function onOpenClose() {
|
|
2328
|
-
if (typeof this.fd === 'number') {
|
|
2329
|
-
// actually close down the fd
|
|
2330
|
-
this.close();
|
|
2331
|
-
}
|
|
2332
|
-
}
|
|
2333
|
-
|
|
2334
|
-
/***/ }),
|
|
2335
|
-
|
|
2336
|
-
/***/ 648:
|
|
2337
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2338
|
-
|
|
2339
|
-
"use strict";
|
|
2340
|
-
/*!
|
|
2341
|
-
* statuses
|
|
2342
|
-
* Copyright(c) 2014 Jonathan Ong
|
|
2343
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
2344
|
-
* MIT Licensed
|
|
2345
|
-
*/
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
/**
|
|
2350
|
-
* Module dependencies.
|
|
2351
|
-
* @private
|
|
2352
|
-
*/
|
|
2353
|
-
var codes = __webpack_require__(100);
|
|
2354
|
-
|
|
2355
|
-
/**
|
|
2356
|
-
* Module exports.
|
|
2357
|
-
* @public
|
|
2358
|
-
*/
|
|
2359
|
-
|
|
2360
|
-
module.exports = status;
|
|
2361
|
-
|
|
2362
|
-
// status code to message map
|
|
2363
|
-
status.message = codes;
|
|
2364
|
-
|
|
2365
|
-
// status message (lower-case) to code map
|
|
2366
|
-
status.code = createMessageToStatusCodeMap(codes);
|
|
2367
|
-
|
|
2368
|
-
// array of status codes
|
|
2369
|
-
status.codes = createStatusCodeList(codes);
|
|
2370
|
-
|
|
2371
|
-
// status codes for redirects
|
|
2372
|
-
status.redirect = {
|
|
2373
|
-
300: true,
|
|
2374
|
-
301: true,
|
|
2375
|
-
302: true,
|
|
2376
|
-
303: true,
|
|
2377
|
-
305: true,
|
|
2378
|
-
307: true,
|
|
2379
|
-
308: true
|
|
2380
|
-
};
|
|
2381
|
-
|
|
2382
|
-
// status codes for empty bodies
|
|
2383
|
-
status.empty = {
|
|
2384
|
-
204: true,
|
|
2385
|
-
205: true,
|
|
2386
|
-
304: true
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
|
-
// status codes for when you should retry the request
|
|
2390
|
-
status.retry = {
|
|
2391
|
-
502: true,
|
|
2392
|
-
503: true,
|
|
2393
|
-
504: true
|
|
2394
|
-
};
|
|
2395
|
-
|
|
2396
|
-
/**
|
|
2397
|
-
* Create a map of message to status code.
|
|
2398
|
-
* @private
|
|
2399
|
-
*/
|
|
2400
|
-
|
|
2401
|
-
function createMessageToStatusCodeMap(codes) {
|
|
2402
|
-
var map = {};
|
|
2403
|
-
Object.keys(codes).forEach(function forEachCode(code) {
|
|
2404
|
-
var message = codes[code];
|
|
2405
|
-
var status = Number(code);
|
|
2406
|
-
|
|
2407
|
-
// populate map
|
|
2408
|
-
map[message.toLowerCase()] = status;
|
|
2409
|
-
});
|
|
2410
|
-
return map;
|
|
2411
|
-
}
|
|
2412
|
-
|
|
2413
|
-
/**
|
|
2414
|
-
* Create a list of all status codes.
|
|
2415
|
-
* @private
|
|
2416
|
-
*/
|
|
2417
|
-
|
|
2418
|
-
function createStatusCodeList(codes) {
|
|
2419
|
-
return Object.keys(codes).map(function mapCode(code) {
|
|
2420
|
-
return Number(code);
|
|
2421
|
-
});
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
|
-
/**
|
|
2425
|
-
* Get the status code for given message.
|
|
2426
|
-
* @private
|
|
2427
|
-
*/
|
|
2428
|
-
|
|
2429
|
-
function getStatusCode(message) {
|
|
2430
|
-
var msg = message.toLowerCase();
|
|
2431
|
-
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
|
|
2432
|
-
throw new Error('invalid status message: "' + message + '"');
|
|
2433
|
-
}
|
|
2434
|
-
return status.code[msg];
|
|
2435
|
-
}
|
|
2436
|
-
|
|
2437
|
-
/**
|
|
2438
|
-
* Get the status message for given code.
|
|
2439
|
-
* @private
|
|
2440
|
-
*/
|
|
2441
|
-
|
|
2442
|
-
function getStatusMessage(code) {
|
|
2443
|
-
if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
|
|
2444
|
-
throw new Error('invalid status code: ' + code);
|
|
2445
|
-
}
|
|
2446
|
-
return status.message[code];
|
|
2447
|
-
}
|
|
2448
|
-
|
|
2449
|
-
/**
|
|
2450
|
-
* Get the status code.
|
|
2451
|
-
*
|
|
2452
|
-
* Given a number, this will throw if it is not a known status
|
|
2453
|
-
* code, otherwise the code will be returned. Given a string,
|
|
2454
|
-
* the string will be parsed for a number and return the code
|
|
2455
|
-
* if valid, otherwise will lookup the code assuming this is
|
|
2456
|
-
* the status message.
|
|
2457
|
-
*
|
|
2458
|
-
* @param {string|number} code
|
|
2459
|
-
* @returns {number}
|
|
2460
|
-
* @public
|
|
2461
|
-
*/
|
|
2462
|
-
|
|
2463
|
-
function status(code) {
|
|
2464
|
-
if (typeof code === 'number') {
|
|
2465
|
-
return getStatusMessage(code);
|
|
2466
|
-
}
|
|
2467
|
-
if (typeof code !== 'string') {
|
|
2468
|
-
throw new TypeError('code must be a number or string');
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
// '403'
|
|
2472
|
-
var n = parseInt(code, 10);
|
|
2473
|
-
if (!isNaN(n)) {
|
|
2474
|
-
return getStatusMessage(n);
|
|
2475
|
-
}
|
|
2476
|
-
return getStatusCode(code);
|
|
2477
|
-
}
|
|
2478
|
-
|
|
2479
|
-
/***/ }),
|
|
2480
|
-
|
|
2481
|
-
/***/ 726:
|
|
2482
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2483
|
-
|
|
2484
|
-
try {
|
|
2485
|
-
var util = __webpack_require__(404);
|
|
2486
|
-
/* istanbul ignore next */
|
|
2487
|
-
if (typeof util.inherits !== 'function') throw '';
|
|
2488
|
-
module.exports = util.inherits;
|
|
2489
|
-
} catch (e) {
|
|
2490
|
-
/* istanbul ignore next */
|
|
2491
|
-
module.exports = __webpack_require__(365);
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
/***/ }),
|
|
2495
|
-
|
|
2496
|
-
/***/ 750:
|
|
2497
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2498
|
-
|
|
2499
|
-
"use strict";
|
|
2500
|
-
/*!
|
|
2501
|
-
* send
|
|
2502
|
-
* Copyright(c) 2012 TJ Holowaychuk
|
|
2503
|
-
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
2504
|
-
* MIT Licensed
|
|
2505
|
-
*/
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
/**
|
|
2510
|
-
* Module dependencies.
|
|
2511
|
-
* @private
|
|
2512
|
-
*/
|
|
2513
|
-
var createError = __webpack_require__(88);
|
|
2514
|
-
var debug = __webpack_require__(68)('send');
|
|
2515
|
-
var deprecate = __webpack_require__(959)('send');
|
|
2516
|
-
var destroy = __webpack_require__(637);
|
|
2517
|
-
var encodeUrl = __webpack_require__(987);
|
|
2518
|
-
var escapeHtml = __webpack_require__(415);
|
|
2519
|
-
var etag = __webpack_require__(193);
|
|
2520
|
-
var fresh = __webpack_require__(480);
|
|
2521
|
-
var fs = __webpack_require__(896);
|
|
2522
|
-
var mime = __webpack_require__(274);
|
|
2523
|
-
var ms = __webpack_require__(811);
|
|
2524
|
-
var onFinished = __webpack_require__(420);
|
|
2525
|
-
var parseRange = __webpack_require__(479);
|
|
2526
|
-
var path = __webpack_require__(928);
|
|
2527
|
-
var statuses = __webpack_require__(648);
|
|
2528
|
-
var Stream = __webpack_require__(203);
|
|
2529
|
-
var util = __webpack_require__(404);
|
|
2530
|
-
|
|
2531
|
-
/**
|
|
2532
|
-
* Path function references.
|
|
2533
|
-
* @private
|
|
2534
|
-
*/
|
|
2535
|
-
|
|
2536
|
-
var extname = path.extname;
|
|
2537
|
-
var join = path.join;
|
|
2538
|
-
var normalize = path.normalize;
|
|
2539
|
-
var resolve = path.resolve;
|
|
2540
|
-
var sep = path.sep;
|
|
2541
|
-
|
|
2542
|
-
/**
|
|
2543
|
-
* Regular expression for identifying a bytes Range header.
|
|
2544
|
-
* @private
|
|
2545
|
-
*/
|
|
2546
|
-
|
|
2547
|
-
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
2548
|
-
|
|
2549
|
-
/**
|
|
2550
|
-
* Maximum value allowed for the max age.
|
|
2551
|
-
* @private
|
|
2552
|
-
*/
|
|
2553
|
-
|
|
2554
|
-
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000; // 1 year
|
|
2555
|
-
|
|
2556
|
-
/**
|
|
2557
|
-
* Regular expression to match a path with a directory up component.
|
|
2558
|
-
* @private
|
|
2559
|
-
*/
|
|
2560
|
-
|
|
2561
|
-
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
2562
|
-
|
|
2563
|
-
/**
|
|
2564
|
-
* Module exports.
|
|
2565
|
-
* @public
|
|
2566
|
-
*/
|
|
2567
|
-
|
|
2568
|
-
module.exports = send;
|
|
2569
|
-
module.exports.mime = mime;
|
|
2570
|
-
|
|
2571
|
-
/**
|
|
2572
|
-
* Return a `SendStream` for `req` and `path`.
|
|
2573
|
-
*
|
|
2574
|
-
* @param {object} req
|
|
2575
|
-
* @param {string} path
|
|
2576
|
-
* @param {object} [options]
|
|
2577
|
-
* @return {SendStream}
|
|
2578
|
-
* @public
|
|
2579
|
-
*/
|
|
2580
|
-
|
|
2581
|
-
function send(req, path, options) {
|
|
2582
|
-
return new SendStream(req, path, options);
|
|
2583
|
-
}
|
|
2584
|
-
|
|
2585
|
-
/**
|
|
2586
|
-
* Initialize a `SendStream` with the given `path`.
|
|
2587
|
-
*
|
|
2588
|
-
* @param {Request} req
|
|
2589
|
-
* @param {String} path
|
|
2590
|
-
* @param {object} [options]
|
|
2591
|
-
* @private
|
|
2592
|
-
*/
|
|
2593
|
-
|
|
2594
|
-
function SendStream(req, path, options) {
|
|
2595
|
-
Stream.call(this);
|
|
2596
|
-
var opts = options || {};
|
|
2597
|
-
this.options = opts;
|
|
2598
|
-
this.path = path;
|
|
2599
|
-
this.req = req;
|
|
2600
|
-
this._acceptRanges = opts.acceptRanges !== undefined ? Boolean(opts.acceptRanges) : true;
|
|
2601
|
-
this._cacheControl = opts.cacheControl !== undefined ? Boolean(opts.cacheControl) : true;
|
|
2602
|
-
this._etag = opts.etag !== undefined ? Boolean(opts.etag) : true;
|
|
2603
|
-
this._dotfiles = opts.dotfiles !== undefined ? opts.dotfiles : 'ignore';
|
|
2604
|
-
if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') {
|
|
2605
|
-
throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');
|
|
2606
|
-
}
|
|
2607
|
-
this._hidden = Boolean(opts.hidden);
|
|
2608
|
-
if (opts.hidden !== undefined) {
|
|
2609
|
-
deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead');
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
|
-
// legacy support
|
|
2613
|
-
if (opts.dotfiles === undefined) {
|
|
2614
|
-
this._dotfiles = undefined;
|
|
2615
|
-
}
|
|
2616
|
-
this._extensions = opts.extensions !== undefined ? normalizeList(opts.extensions, 'extensions option') : [];
|
|
2617
|
-
this._immutable = opts.immutable !== undefined ? Boolean(opts.immutable) : false;
|
|
2618
|
-
this._index = opts.index !== undefined ? normalizeList(opts.index, 'index option') : ['index.html'];
|
|
2619
|
-
this._lastModified = opts.lastModified !== undefined ? Boolean(opts.lastModified) : true;
|
|
2620
|
-
this._maxage = opts.maxAge || opts.maxage;
|
|
2621
|
-
this._maxage = typeof this._maxage === 'string' ? ms(this._maxage) : Number(this._maxage);
|
|
2622
|
-
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
2623
|
-
this._root = opts.root ? resolve(opts.root) : null;
|
|
2624
|
-
if (!this._root && opts.from) {
|
|
2625
|
-
this.from(opts.from);
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
/**
|
|
2630
|
-
* Inherits from `Stream`.
|
|
2631
|
-
*/
|
|
2632
|
-
|
|
2633
|
-
util.inherits(SendStream, Stream);
|
|
2634
|
-
|
|
2635
|
-
/**
|
|
2636
|
-
* Enable or disable etag generation.
|
|
2637
|
-
*
|
|
2638
|
-
* @param {Boolean} val
|
|
2639
|
-
* @return {SendStream}
|
|
2640
|
-
* @api public
|
|
2641
|
-
*/
|
|
2642
|
-
|
|
2643
|
-
SendStream.prototype.etag = deprecate.function(function etag(val) {
|
|
2644
|
-
this._etag = Boolean(val);
|
|
2645
|
-
debug('etag %s', this._etag);
|
|
2646
|
-
return this;
|
|
2647
|
-
}, 'send.etag: pass etag as option');
|
|
2648
|
-
|
|
2649
|
-
/**
|
|
2650
|
-
* Enable or disable "hidden" (dot) files.
|
|
2651
|
-
*
|
|
2652
|
-
* @param {Boolean} path
|
|
2653
|
-
* @return {SendStream}
|
|
2654
|
-
* @api public
|
|
2655
|
-
*/
|
|
2656
|
-
|
|
2657
|
-
SendStream.prototype.hidden = deprecate.function(function hidden(val) {
|
|
2658
|
-
this._hidden = Boolean(val);
|
|
2659
|
-
this._dotfiles = undefined;
|
|
2660
|
-
debug('hidden %s', this._hidden);
|
|
2661
|
-
return this;
|
|
2662
|
-
}, 'send.hidden: use dotfiles option');
|
|
2663
|
-
|
|
2664
|
-
/**
|
|
2665
|
-
* Set index `paths`, set to a falsy
|
|
2666
|
-
* value to disable index support.
|
|
2667
|
-
*
|
|
2668
|
-
* @param {String|Boolean|Array} paths
|
|
2669
|
-
* @return {SendStream}
|
|
2670
|
-
* @api public
|
|
2671
|
-
*/
|
|
2672
|
-
|
|
2673
|
-
SendStream.prototype.index = deprecate.function(function index(paths) {
|
|
2674
|
-
var index = !paths ? [] : normalizeList(paths, 'paths argument');
|
|
2675
|
-
debug('index %o', paths);
|
|
2676
|
-
this._index = index;
|
|
2677
|
-
return this;
|
|
2678
|
-
}, 'send.index: pass index as option');
|
|
2679
|
-
|
|
2680
|
-
/**
|
|
2681
|
-
* Set root `path`.
|
|
2682
|
-
*
|
|
2683
|
-
* @param {String} path
|
|
2684
|
-
* @return {SendStream}
|
|
2685
|
-
* @api public
|
|
2686
|
-
*/
|
|
2687
|
-
|
|
2688
|
-
SendStream.prototype.root = function root(path) {
|
|
2689
|
-
this._root = resolve(String(path));
|
|
2690
|
-
debug('root %s', this._root);
|
|
2691
|
-
return this;
|
|
2692
|
-
};
|
|
2693
|
-
SendStream.prototype.from = deprecate.function(SendStream.prototype.root, 'send.from: pass root as option');
|
|
2694
|
-
SendStream.prototype.root = deprecate.function(SendStream.prototype.root, 'send.root: pass root as option');
|
|
2695
|
-
|
|
2696
|
-
/**
|
|
2697
|
-
* Set max-age to `maxAge`.
|
|
2698
|
-
*
|
|
2699
|
-
* @param {Number} maxAge
|
|
2700
|
-
* @return {SendStream}
|
|
2701
|
-
* @api public
|
|
2702
|
-
*/
|
|
2703
|
-
|
|
2704
|
-
SendStream.prototype.maxage = deprecate.function(function maxage(maxAge) {
|
|
2705
|
-
this._maxage = typeof maxAge === 'string' ? ms(maxAge) : Number(maxAge);
|
|
2706
|
-
this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
|
|
2707
|
-
debug('max-age %d', this._maxage);
|
|
2708
|
-
return this;
|
|
2709
|
-
}, 'send.maxage: pass maxAge as option');
|
|
2710
|
-
|
|
2711
|
-
/**
|
|
2712
|
-
* Emit error with `status`.
|
|
2713
|
-
*
|
|
2714
|
-
* @param {number} status
|
|
2715
|
-
* @param {Error} [err]
|
|
2716
|
-
* @private
|
|
2717
|
-
*/
|
|
2718
|
-
|
|
2719
|
-
SendStream.prototype.error = function error(status, err) {
|
|
2720
|
-
// emit if listeners instead of responding
|
|
2721
|
-
if (hasListeners(this, 'error')) {
|
|
2722
|
-
return this.emit('error', createHttpError(status, err));
|
|
2723
|
-
}
|
|
2724
|
-
var res = this.res;
|
|
2725
|
-
var msg = statuses.message[status] || String(status);
|
|
2726
|
-
var doc = createHtmlDocument('Error', escapeHtml(msg));
|
|
2727
|
-
|
|
2728
|
-
// clear existing headers
|
|
2729
|
-
clearHeaders(res);
|
|
2730
|
-
|
|
2731
|
-
// add error headers
|
|
2732
|
-
if (err && err.headers) {
|
|
2733
|
-
setHeaders(res, err.headers);
|
|
2734
|
-
}
|
|
2735
|
-
|
|
2736
|
-
// send basic response
|
|
2737
|
-
res.statusCode = status;
|
|
2738
|
-
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
|
2739
|
-
res.setHeader('Content-Length', Buffer.byteLength(doc));
|
|
2740
|
-
res.setHeader('Content-Security-Policy', "default-src 'none'");
|
|
2741
|
-
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
2742
|
-
res.end(doc);
|
|
2743
|
-
};
|
|
2744
|
-
|
|
2745
|
-
/**
|
|
2746
|
-
* Check if the pathname ends with "/".
|
|
2747
|
-
*
|
|
2748
|
-
* @return {boolean}
|
|
2749
|
-
* @private
|
|
2750
|
-
*/
|
|
2751
|
-
|
|
2752
|
-
SendStream.prototype.hasTrailingSlash = function hasTrailingSlash() {
|
|
2753
|
-
return this.path[this.path.length - 1] === '/';
|
|
2754
|
-
};
|
|
2755
|
-
|
|
2756
|
-
/**
|
|
2757
|
-
* Check if this is a conditional GET request.
|
|
2758
|
-
*
|
|
2759
|
-
* @return {Boolean}
|
|
2760
|
-
* @api private
|
|
2761
|
-
*/
|
|
2762
|
-
|
|
2763
|
-
SendStream.prototype.isConditionalGET = function isConditionalGET() {
|
|
2764
|
-
return this.req.headers['if-match'] || this.req.headers['if-unmodified-since'] || this.req.headers['if-none-match'] || this.req.headers['if-modified-since'];
|
|
2765
|
-
};
|
|
2766
|
-
|
|
2767
|
-
/**
|
|
2768
|
-
* Check if the request preconditions failed.
|
|
2769
|
-
*
|
|
2770
|
-
* @return {boolean}
|
|
2771
|
-
* @private
|
|
2772
|
-
*/
|
|
2773
|
-
|
|
2774
|
-
SendStream.prototype.isPreconditionFailure = function isPreconditionFailure() {
|
|
2775
|
-
var req = this.req;
|
|
2776
|
-
var res = this.res;
|
|
2777
|
-
|
|
2778
|
-
// if-match
|
|
2779
|
-
var match = req.headers['if-match'];
|
|
2780
|
-
if (match) {
|
|
2781
|
-
var etag = res.getHeader('ETag');
|
|
2782
|
-
return !etag || match !== '*' && parseTokenList(match).every(function (match) {
|
|
2783
|
-
return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag;
|
|
2784
|
-
});
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
|
-
// if-unmodified-since
|
|
2788
|
-
var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since']);
|
|
2789
|
-
if (!isNaN(unmodifiedSince)) {
|
|
2790
|
-
var lastModified = parseHttpDate(res.getHeader('Last-Modified'));
|
|
2791
|
-
return isNaN(lastModified) || lastModified > unmodifiedSince;
|
|
2792
|
-
}
|
|
2793
|
-
return false;
|
|
2794
|
-
};
|
|
2795
|
-
|
|
2796
|
-
/**
|
|
2797
|
-
* Strip various content header fields for a change in entity.
|
|
2798
|
-
*
|
|
2799
|
-
* @private
|
|
2800
|
-
*/
|
|
2801
|
-
|
|
2802
|
-
SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields() {
|
|
2803
|
-
var res = this.res;
|
|
2804
|
-
res.removeHeader('Content-Encoding');
|
|
2805
|
-
res.removeHeader('Content-Language');
|
|
2806
|
-
res.removeHeader('Content-Length');
|
|
2807
|
-
res.removeHeader('Content-Range');
|
|
2808
|
-
res.removeHeader('Content-Type');
|
|
2809
|
-
};
|
|
2810
|
-
|
|
2811
|
-
/**
|
|
2812
|
-
* Respond with 304 not modified.
|
|
2813
|
-
*
|
|
2814
|
-
* @api private
|
|
2815
|
-
*/
|
|
2816
|
-
|
|
2817
|
-
SendStream.prototype.notModified = function notModified() {
|
|
2818
|
-
var res = this.res;
|
|
2819
|
-
debug('not modified');
|
|
2820
|
-
this.removeContentHeaderFields();
|
|
2821
|
-
res.statusCode = 304;
|
|
2822
|
-
res.end();
|
|
2823
|
-
};
|
|
2824
|
-
|
|
2825
|
-
/**
|
|
2826
|
-
* Raise error that headers already sent.
|
|
2827
|
-
*
|
|
2828
|
-
* @api private
|
|
2829
|
-
*/
|
|
2830
|
-
|
|
2831
|
-
SendStream.prototype.headersAlreadySent = function headersAlreadySent() {
|
|
2832
|
-
var err = new Error('Can\'t set headers after they are sent.');
|
|
2833
|
-
debug('headers already sent');
|
|
2834
|
-
this.error(500, err);
|
|
2835
|
-
};
|
|
2836
|
-
|
|
2837
|
-
/**
|
|
2838
|
-
* Check if the request is cacheable, aka
|
|
2839
|
-
* responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
|
|
2840
|
-
*
|
|
2841
|
-
* @return {Boolean}
|
|
2842
|
-
* @api private
|
|
2843
|
-
*/
|
|
2844
|
-
|
|
2845
|
-
SendStream.prototype.isCachable = function isCachable() {
|
|
2846
|
-
var statusCode = this.res.statusCode;
|
|
2847
|
-
return statusCode >= 200 && statusCode < 300 || statusCode === 304;
|
|
2848
|
-
};
|
|
2849
|
-
|
|
2850
|
-
/**
|
|
2851
|
-
* Handle stat() error.
|
|
2852
|
-
*
|
|
2853
|
-
* @param {Error} error
|
|
2854
|
-
* @private
|
|
2855
|
-
*/
|
|
2856
|
-
|
|
2857
|
-
SendStream.prototype.onStatError = function onStatError(error) {
|
|
2858
|
-
switch (error.code) {
|
|
2859
|
-
case 'ENAMETOOLONG':
|
|
2860
|
-
case 'ENOENT':
|
|
2861
|
-
case 'ENOTDIR':
|
|
2862
|
-
this.error(404, error);
|
|
2863
|
-
break;
|
|
2864
|
-
default:
|
|
2865
|
-
this.error(500, error);
|
|
2866
|
-
break;
|
|
2867
|
-
}
|
|
2868
|
-
};
|
|
2869
|
-
|
|
2870
|
-
/**
|
|
2871
|
-
* Check if the cache is fresh.
|
|
2872
|
-
*
|
|
2873
|
-
* @return {Boolean}
|
|
2874
|
-
* @api private
|
|
2875
|
-
*/
|
|
2876
|
-
|
|
2877
|
-
SendStream.prototype.isFresh = function isFresh() {
|
|
2878
|
-
return fresh(this.req.headers, {
|
|
2879
|
-
etag: this.res.getHeader('ETag'),
|
|
2880
|
-
'last-modified': this.res.getHeader('Last-Modified')
|
|
2881
|
-
});
|
|
2882
|
-
};
|
|
2883
|
-
|
|
2884
|
-
/**
|
|
2885
|
-
* Check if the range is fresh.
|
|
2886
|
-
*
|
|
2887
|
-
* @return {Boolean}
|
|
2888
|
-
* @api private
|
|
2889
|
-
*/
|
|
2890
|
-
|
|
2891
|
-
SendStream.prototype.isRangeFresh = function isRangeFresh() {
|
|
2892
|
-
var ifRange = this.req.headers['if-range'];
|
|
2893
|
-
if (!ifRange) {
|
|
2894
|
-
return true;
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
|
-
// if-range as etag
|
|
2898
|
-
if (ifRange.indexOf('"') !== -1) {
|
|
2899
|
-
var etag = this.res.getHeader('ETag');
|
|
2900
|
-
return Boolean(etag && ifRange.indexOf(etag) !== -1);
|
|
2901
|
-
}
|
|
2902
|
-
|
|
2903
|
-
// if-range as modified date
|
|
2904
|
-
var lastModified = this.res.getHeader('Last-Modified');
|
|
2905
|
-
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
2906
|
-
};
|
|
2907
|
-
|
|
2908
|
-
/**
|
|
2909
|
-
* Redirect to path.
|
|
2910
|
-
*
|
|
2911
|
-
* @param {string} path
|
|
2912
|
-
* @private
|
|
2913
|
-
*/
|
|
2914
|
-
|
|
2915
|
-
SendStream.prototype.redirect = function redirect(path) {
|
|
2916
|
-
var res = this.res;
|
|
2917
|
-
if (hasListeners(this, 'directory')) {
|
|
2918
|
-
this.emit('directory', res, path);
|
|
2919
|
-
return;
|
|
2920
|
-
}
|
|
2921
|
-
if (this.hasTrailingSlash()) {
|
|
2922
|
-
this.error(403);
|
|
2923
|
-
return;
|
|
2924
|
-
}
|
|
2925
|
-
var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'));
|
|
2926
|
-
var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc));
|
|
2927
|
-
|
|
2928
|
-
// redirect
|
|
2929
|
-
res.statusCode = 301;
|
|
2930
|
-
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
|
2931
|
-
res.setHeader('Content-Length', Buffer.byteLength(doc));
|
|
2932
|
-
res.setHeader('Content-Security-Policy', "default-src 'none'");
|
|
2933
|
-
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
2934
|
-
res.setHeader('Location', loc);
|
|
2935
|
-
res.end(doc);
|
|
2936
|
-
};
|
|
2937
|
-
|
|
2938
|
-
/**
|
|
2939
|
-
* Pipe to `res.
|
|
2940
|
-
*
|
|
2941
|
-
* @param {Stream} res
|
|
2942
|
-
* @return {Stream} res
|
|
2943
|
-
* @api public
|
|
2944
|
-
*/
|
|
2945
|
-
|
|
2946
|
-
SendStream.prototype.pipe = function pipe(res) {
|
|
2947
|
-
// root path
|
|
2948
|
-
var root = this._root;
|
|
2949
|
-
|
|
2950
|
-
// references
|
|
2951
|
-
this.res = res;
|
|
2952
|
-
|
|
2953
|
-
// decode the path
|
|
2954
|
-
var path = decode(this.path);
|
|
2955
|
-
if (path === -1) {
|
|
2956
|
-
this.error(400);
|
|
2957
|
-
return res;
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
// null byte(s)
|
|
2961
|
-
if (~path.indexOf('\0')) {
|
|
2962
|
-
this.error(400);
|
|
2963
|
-
return res;
|
|
2964
|
-
}
|
|
2965
|
-
var parts;
|
|
2966
|
-
if (root !== null) {
|
|
2967
|
-
// normalize
|
|
2968
|
-
if (path) {
|
|
2969
|
-
path = normalize('.' + sep + path);
|
|
2970
|
-
}
|
|
2971
|
-
|
|
2972
|
-
// malicious path
|
|
2973
|
-
if (UP_PATH_REGEXP.test(path)) {
|
|
2974
|
-
debug('malicious path "%s"', path);
|
|
2975
|
-
this.error(403);
|
|
2976
|
-
return res;
|
|
2977
|
-
}
|
|
2978
|
-
|
|
2979
|
-
// explode path parts
|
|
2980
|
-
parts = path.split(sep);
|
|
2981
|
-
|
|
2982
|
-
// join / normalize from optional root dir
|
|
2983
|
-
path = normalize(join(root, path));
|
|
2984
|
-
} else {
|
|
2985
|
-
// ".." is malicious without "root"
|
|
2986
|
-
if (UP_PATH_REGEXP.test(path)) {
|
|
2987
|
-
debug('malicious path "%s"', path);
|
|
2988
|
-
this.error(403);
|
|
2989
|
-
return res;
|
|
2990
|
-
}
|
|
2991
|
-
|
|
2992
|
-
// explode path parts
|
|
2993
|
-
parts = normalize(path).split(sep);
|
|
2994
|
-
|
|
2995
|
-
// resolve the path
|
|
2996
|
-
path = resolve(path);
|
|
2997
|
-
}
|
|
2998
|
-
|
|
2999
|
-
// dotfile handling
|
|
3000
|
-
if (containsDotFile(parts)) {
|
|
3001
|
-
var access = this._dotfiles;
|
|
3002
|
-
|
|
3003
|
-
// legacy support
|
|
3004
|
-
if (access === undefined) {
|
|
3005
|
-
access = parts[parts.length - 1][0] === '.' ? this._hidden ? 'allow' : 'ignore' : 'allow';
|
|
3006
|
-
}
|
|
3007
|
-
debug('%s dotfile "%s"', access, path);
|
|
3008
|
-
switch (access) {
|
|
3009
|
-
case 'allow':
|
|
3010
|
-
break;
|
|
3011
|
-
case 'deny':
|
|
3012
|
-
this.error(403);
|
|
3013
|
-
return res;
|
|
3014
|
-
case 'ignore':
|
|
3015
|
-
default:
|
|
3016
|
-
this.error(404);
|
|
3017
|
-
return res;
|
|
3018
|
-
}
|
|
3019
|
-
}
|
|
3020
|
-
|
|
3021
|
-
// index file support
|
|
3022
|
-
if (this._index.length && this.hasTrailingSlash()) {
|
|
3023
|
-
this.sendIndex(path);
|
|
3024
|
-
return res;
|
|
3025
|
-
}
|
|
3026
|
-
this.sendFile(path);
|
|
3027
|
-
return res;
|
|
3028
|
-
};
|
|
3029
|
-
|
|
3030
|
-
/**
|
|
3031
|
-
* Transfer `path`.
|
|
3032
|
-
*
|
|
3033
|
-
* @param {String} path
|
|
3034
|
-
* @api public
|
|
3035
|
-
*/
|
|
3036
|
-
|
|
3037
|
-
SendStream.prototype.send = function send(path, stat) {
|
|
3038
|
-
var len = stat.size;
|
|
3039
|
-
var options = this.options;
|
|
3040
|
-
var opts = {};
|
|
3041
|
-
var res = this.res;
|
|
3042
|
-
var req = this.req;
|
|
3043
|
-
var ranges = req.headers.range;
|
|
3044
|
-
var offset = options.start || 0;
|
|
3045
|
-
if (headersSent(res)) {
|
|
3046
|
-
// impossible to send now
|
|
3047
|
-
this.headersAlreadySent();
|
|
3048
|
-
return;
|
|
3049
|
-
}
|
|
3050
|
-
debug('pipe "%s"', path);
|
|
3051
|
-
|
|
3052
|
-
// set header fields
|
|
3053
|
-
this.setHeader(path, stat);
|
|
3054
|
-
|
|
3055
|
-
// set content-type
|
|
3056
|
-
this.type(path);
|
|
3057
|
-
|
|
3058
|
-
// conditional GET support
|
|
3059
|
-
if (this.isConditionalGET()) {
|
|
3060
|
-
if (this.isPreconditionFailure()) {
|
|
3061
|
-
this.error(412);
|
|
3062
|
-
return;
|
|
3063
|
-
}
|
|
3064
|
-
if (this.isCachable() && this.isFresh()) {
|
|
3065
|
-
this.notModified();
|
|
3066
|
-
return;
|
|
3067
|
-
}
|
|
3068
|
-
}
|
|
3069
|
-
|
|
3070
|
-
// adjust len to start/end options
|
|
3071
|
-
len = Math.max(0, len - offset);
|
|
3072
|
-
if (options.end !== undefined) {
|
|
3073
|
-
var bytes = options.end - offset + 1;
|
|
3074
|
-
if (len > bytes) len = bytes;
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
// Range support
|
|
3078
|
-
if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) {
|
|
3079
|
-
// parse
|
|
3080
|
-
ranges = parseRange(len, ranges, {
|
|
3081
|
-
combine: true
|
|
3082
|
-
});
|
|
3083
|
-
|
|
3084
|
-
// If-Range support
|
|
3085
|
-
if (!this.isRangeFresh()) {
|
|
3086
|
-
debug('range stale');
|
|
3087
|
-
ranges = -2;
|
|
3088
|
-
}
|
|
3089
|
-
|
|
3090
|
-
// unsatisfiable
|
|
3091
|
-
if (ranges === -1) {
|
|
3092
|
-
debug('range unsatisfiable');
|
|
3093
|
-
|
|
3094
|
-
// Content-Range
|
|
3095
|
-
res.setHeader('Content-Range', contentRange('bytes', len));
|
|
3096
|
-
|
|
3097
|
-
// 416 Requested Range Not Satisfiable
|
|
3098
|
-
return this.error(416, {
|
|
3099
|
-
headers: {
|
|
3100
|
-
'Content-Range': res.getHeader('Content-Range')
|
|
3101
|
-
}
|
|
3102
|
-
});
|
|
3103
|
-
}
|
|
3104
|
-
|
|
3105
|
-
// valid (syntactically invalid/multiple ranges are treated as a regular response)
|
|
3106
|
-
if (ranges !== -2 && ranges.length === 1) {
|
|
3107
|
-
debug('range %j', ranges);
|
|
3108
|
-
|
|
3109
|
-
// Content-Range
|
|
3110
|
-
res.statusCode = 206;
|
|
3111
|
-
res.setHeader('Content-Range', contentRange('bytes', len, ranges[0]));
|
|
3112
|
-
|
|
3113
|
-
// adjust for requested range
|
|
3114
|
-
offset += ranges[0].start;
|
|
3115
|
-
len = ranges[0].end - ranges[0].start + 1;
|
|
3116
|
-
}
|
|
3117
|
-
}
|
|
3118
|
-
|
|
3119
|
-
// clone options
|
|
3120
|
-
for (var prop in options) {
|
|
3121
|
-
opts[prop] = options[prop];
|
|
3122
|
-
}
|
|
3123
|
-
|
|
3124
|
-
// set read options
|
|
3125
|
-
opts.start = offset;
|
|
3126
|
-
opts.end = Math.max(offset, offset + len - 1);
|
|
3127
|
-
|
|
3128
|
-
// content-length
|
|
3129
|
-
res.setHeader('Content-Length', len);
|
|
3130
|
-
|
|
3131
|
-
// HEAD support
|
|
3132
|
-
if (req.method === 'HEAD') {
|
|
3133
|
-
res.end();
|
|
3134
|
-
return;
|
|
3135
|
-
}
|
|
3136
|
-
this.stream(path, opts);
|
|
3137
|
-
};
|
|
3138
|
-
|
|
3139
|
-
/**
|
|
3140
|
-
* Transfer file for `path`.
|
|
3141
|
-
*
|
|
3142
|
-
* @param {String} path
|
|
3143
|
-
* @api private
|
|
3144
|
-
*/
|
|
3145
|
-
SendStream.prototype.sendFile = function sendFile(path) {
|
|
3146
|
-
var i = 0;
|
|
3147
|
-
var self = this;
|
|
3148
|
-
debug('stat "%s"', path);
|
|
3149
|
-
fs.stat(path, function onstat(err, stat) {
|
|
3150
|
-
if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) {
|
|
3151
|
-
// not found, check extensions
|
|
3152
|
-
return next(err);
|
|
3153
|
-
}
|
|
3154
|
-
if (err) return self.onStatError(err);
|
|
3155
|
-
if (stat.isDirectory()) return self.redirect(path);
|
|
3156
|
-
self.emit('file', path, stat);
|
|
3157
|
-
self.send(path, stat);
|
|
3158
|
-
});
|
|
3159
|
-
function next(err) {
|
|
3160
|
-
if (self._extensions.length <= i) {
|
|
3161
|
-
return err ? self.onStatError(err) : self.error(404);
|
|
3162
|
-
}
|
|
3163
|
-
var p = path + '.' + self._extensions[i++];
|
|
3164
|
-
debug('stat "%s"', p);
|
|
3165
|
-
fs.stat(p, function (err, stat) {
|
|
3166
|
-
if (err) return next(err);
|
|
3167
|
-
if (stat.isDirectory()) return next();
|
|
3168
|
-
self.emit('file', p, stat);
|
|
3169
|
-
self.send(p, stat);
|
|
3170
|
-
});
|
|
3171
|
-
}
|
|
3172
|
-
};
|
|
3173
|
-
|
|
3174
|
-
/**
|
|
3175
|
-
* Transfer index for `path`.
|
|
3176
|
-
*
|
|
3177
|
-
* @param {String} path
|
|
3178
|
-
* @api private
|
|
3179
|
-
*/
|
|
3180
|
-
SendStream.prototype.sendIndex = function sendIndex(path) {
|
|
3181
|
-
var i = -1;
|
|
3182
|
-
var self = this;
|
|
3183
|
-
function next(err) {
|
|
3184
|
-
if (++i >= self._index.length) {
|
|
3185
|
-
if (err) return self.onStatError(err);
|
|
3186
|
-
return self.error(404);
|
|
3187
|
-
}
|
|
3188
|
-
var p = join(path, self._index[i]);
|
|
3189
|
-
debug('stat "%s"', p);
|
|
3190
|
-
fs.stat(p, function (err, stat) {
|
|
3191
|
-
if (err) return next(err);
|
|
3192
|
-
if (stat.isDirectory()) return next();
|
|
3193
|
-
self.emit('file', p, stat);
|
|
3194
|
-
self.send(p, stat);
|
|
3195
|
-
});
|
|
3196
|
-
}
|
|
3197
|
-
next();
|
|
3198
|
-
};
|
|
3199
|
-
|
|
3200
|
-
/**
|
|
3201
|
-
* Stream `path` to the response.
|
|
3202
|
-
*
|
|
3203
|
-
* @param {String} path
|
|
3204
|
-
* @param {Object} options
|
|
3205
|
-
* @api private
|
|
3206
|
-
*/
|
|
3207
|
-
|
|
3208
|
-
SendStream.prototype.stream = function stream(path, options) {
|
|
3209
|
-
var self = this;
|
|
3210
|
-
var res = this.res;
|
|
3211
|
-
|
|
3212
|
-
// pipe
|
|
3213
|
-
var stream = fs.createReadStream(path, options);
|
|
3214
|
-
this.emit('stream', stream);
|
|
3215
|
-
stream.pipe(res);
|
|
3216
|
-
|
|
3217
|
-
// cleanup
|
|
3218
|
-
function cleanup() {
|
|
3219
|
-
destroy(stream, true);
|
|
3220
|
-
}
|
|
3221
|
-
|
|
3222
|
-
// response finished, cleanup
|
|
3223
|
-
onFinished(res, cleanup);
|
|
3224
|
-
|
|
3225
|
-
// error handling
|
|
3226
|
-
stream.on('error', function onerror(err) {
|
|
3227
|
-
// clean up stream early
|
|
3228
|
-
cleanup();
|
|
3229
|
-
|
|
3230
|
-
// error
|
|
3231
|
-
self.onStatError(err);
|
|
3232
|
-
});
|
|
3233
|
-
|
|
3234
|
-
// end
|
|
3235
|
-
stream.on('end', function onend() {
|
|
3236
|
-
self.emit('end');
|
|
3237
|
-
});
|
|
3238
|
-
};
|
|
3239
|
-
|
|
3240
|
-
/**
|
|
3241
|
-
* Set content-type based on `path`
|
|
3242
|
-
* if it hasn't been explicitly set.
|
|
3243
|
-
*
|
|
3244
|
-
* @param {String} path
|
|
3245
|
-
* @api private
|
|
3246
|
-
*/
|
|
3247
|
-
|
|
3248
|
-
SendStream.prototype.type = function type(path) {
|
|
3249
|
-
var res = this.res;
|
|
3250
|
-
if (res.getHeader('Content-Type')) return;
|
|
3251
|
-
var type = mime.lookup(path);
|
|
3252
|
-
if (!type) {
|
|
3253
|
-
debug('no content-type');
|
|
3254
|
-
return;
|
|
3255
|
-
}
|
|
3256
|
-
var charset = mime.charsets.lookup(type);
|
|
3257
|
-
debug('content-type %s', type);
|
|
3258
|
-
res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''));
|
|
3259
|
-
};
|
|
3260
|
-
|
|
3261
|
-
/**
|
|
3262
|
-
* Set response header fields, most
|
|
3263
|
-
* fields may be pre-defined.
|
|
3264
|
-
*
|
|
3265
|
-
* @param {String} path
|
|
3266
|
-
* @param {Object} stat
|
|
3267
|
-
* @api private
|
|
3268
|
-
*/
|
|
3269
|
-
|
|
3270
|
-
SendStream.prototype.setHeader = function setHeader(path, stat) {
|
|
3271
|
-
var res = this.res;
|
|
3272
|
-
this.emit('headers', res, path, stat);
|
|
3273
|
-
if (this._acceptRanges && !res.getHeader('Accept-Ranges')) {
|
|
3274
|
-
debug('accept ranges');
|
|
3275
|
-
res.setHeader('Accept-Ranges', 'bytes');
|
|
3276
|
-
}
|
|
3277
|
-
if (this._cacheControl && !res.getHeader('Cache-Control')) {
|
|
3278
|
-
var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000);
|
|
3279
|
-
if (this._immutable) {
|
|
3280
|
-
cacheControl += ', immutable';
|
|
3281
|
-
}
|
|
3282
|
-
debug('cache-control %s', cacheControl);
|
|
3283
|
-
res.setHeader('Cache-Control', cacheControl);
|
|
3284
|
-
}
|
|
3285
|
-
if (this._lastModified && !res.getHeader('Last-Modified')) {
|
|
3286
|
-
var modified = stat.mtime.toUTCString();
|
|
3287
|
-
debug('modified %s', modified);
|
|
3288
|
-
res.setHeader('Last-Modified', modified);
|
|
3289
|
-
}
|
|
3290
|
-
if (this._etag && !res.getHeader('ETag')) {
|
|
3291
|
-
var val = etag(stat);
|
|
3292
|
-
debug('etag %s', val);
|
|
3293
|
-
res.setHeader('ETag', val);
|
|
3294
|
-
}
|
|
3295
|
-
};
|
|
3296
|
-
|
|
3297
|
-
/**
|
|
3298
|
-
* Clear all headers from a response.
|
|
3299
|
-
*
|
|
3300
|
-
* @param {object} res
|
|
3301
|
-
* @private
|
|
3302
|
-
*/
|
|
3303
|
-
|
|
3304
|
-
function clearHeaders(res) {
|
|
3305
|
-
var headers = getHeaderNames(res);
|
|
3306
|
-
for (var i = 0; i < headers.length; i++) {
|
|
3307
|
-
res.removeHeader(headers[i]);
|
|
3308
|
-
}
|
|
3309
|
-
}
|
|
3310
|
-
|
|
3311
|
-
/**
|
|
3312
|
-
* Collapse all leading slashes into a single slash
|
|
3313
|
-
*
|
|
3314
|
-
* @param {string} str
|
|
3315
|
-
* @private
|
|
3316
|
-
*/
|
|
3317
|
-
function collapseLeadingSlashes(str) {
|
|
3318
|
-
for (var i = 0; i < str.length; i++) {
|
|
3319
|
-
if (str[i] !== '/') {
|
|
3320
|
-
break;
|
|
3321
|
-
}
|
|
3322
|
-
}
|
|
3323
|
-
return i > 1 ? '/' + str.substr(i) : str;
|
|
3324
|
-
}
|
|
3325
|
-
|
|
3326
|
-
/**
|
|
3327
|
-
* Determine if path parts contain a dotfile.
|
|
3328
|
-
*
|
|
3329
|
-
* @api private
|
|
3330
|
-
*/
|
|
3331
|
-
|
|
3332
|
-
function containsDotFile(parts) {
|
|
3333
|
-
for (var i = 0; i < parts.length; i++) {
|
|
3334
|
-
var part = parts[i];
|
|
3335
|
-
if (part.length > 1 && part[0] === '.') {
|
|
3336
|
-
return true;
|
|
3337
|
-
}
|
|
3338
|
-
}
|
|
3339
|
-
return false;
|
|
3340
|
-
}
|
|
3341
|
-
|
|
3342
|
-
/**
|
|
3343
|
-
* Create a Content-Range header.
|
|
3344
|
-
*
|
|
3345
|
-
* @param {string} type
|
|
3346
|
-
* @param {number} size
|
|
3347
|
-
* @param {array} [range]
|
|
3348
|
-
*/
|
|
3349
|
-
|
|
3350
|
-
function contentRange(type, size, range) {
|
|
3351
|
-
return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size;
|
|
3352
|
-
}
|
|
3353
|
-
|
|
3354
|
-
/**
|
|
3355
|
-
* Create a minimal HTML document.
|
|
3356
|
-
*
|
|
3357
|
-
* @param {string} title
|
|
3358
|
-
* @param {string} body
|
|
3359
|
-
* @private
|
|
3360
|
-
*/
|
|
3361
|
-
|
|
3362
|
-
function createHtmlDocument(title, body) {
|
|
3363
|
-
return '<!DOCTYPE html>\n' + '<html lang="en">\n' + '<head>\n' + '<meta charset="utf-8">\n' + '<title>' + title + '</title>\n' + '</head>\n' + '<body>\n' + '<pre>' + body + '</pre>\n' + '</body>\n' + '</html>\n';
|
|
3364
|
-
}
|
|
3365
|
-
|
|
3366
|
-
/**
|
|
3367
|
-
* Create a HttpError object from simple arguments.
|
|
3368
|
-
*
|
|
3369
|
-
* @param {number} status
|
|
3370
|
-
* @param {Error|object} err
|
|
3371
|
-
* @private
|
|
3372
|
-
*/
|
|
3373
|
-
|
|
3374
|
-
function createHttpError(status, err) {
|
|
3375
|
-
if (!err) {
|
|
3376
|
-
return createError(status);
|
|
3377
|
-
}
|
|
3378
|
-
return err instanceof Error ? createError(status, err, {
|
|
3379
|
-
expose: false
|
|
3380
|
-
}) : createError(status, err);
|
|
3381
|
-
}
|
|
3382
|
-
|
|
3383
|
-
/**
|
|
3384
|
-
* decodeURIComponent.
|
|
3385
|
-
*
|
|
3386
|
-
* Allows V8 to only deoptimize this fn instead of all
|
|
3387
|
-
* of send().
|
|
3388
|
-
*
|
|
3389
|
-
* @param {String} path
|
|
3390
|
-
* @api private
|
|
3391
|
-
*/
|
|
3392
|
-
|
|
3393
|
-
function decode(path) {
|
|
3394
|
-
try {
|
|
3395
|
-
return decodeURIComponent(path);
|
|
3396
|
-
} catch (err) {
|
|
3397
|
-
return -1;
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
|
|
3401
|
-
/**
|
|
3402
|
-
* Get the header names on a respnse.
|
|
3403
|
-
*
|
|
3404
|
-
* @param {object} res
|
|
3405
|
-
* @returns {array[string]}
|
|
3406
|
-
* @private
|
|
3407
|
-
*/
|
|
3408
|
-
|
|
3409
|
-
function getHeaderNames(res) {
|
|
3410
|
-
return typeof res.getHeaderNames !== 'function' ? Object.keys(res._headers || {}) : res.getHeaderNames();
|
|
3411
|
-
}
|
|
3412
|
-
|
|
3413
|
-
/**
|
|
3414
|
-
* Determine if emitter has listeners of a given type.
|
|
3415
|
-
*
|
|
3416
|
-
* The way to do this check is done three different ways in Node.js >= 0.8
|
|
3417
|
-
* so this consolidates them into a minimal set using instance methods.
|
|
3418
|
-
*
|
|
3419
|
-
* @param {EventEmitter} emitter
|
|
3420
|
-
* @param {string} type
|
|
3421
|
-
* @returns {boolean}
|
|
3422
|
-
* @private
|
|
3423
|
-
*/
|
|
3424
|
-
|
|
3425
|
-
function hasListeners(emitter, type) {
|
|
3426
|
-
var count = typeof emitter.listenerCount !== 'function' ? emitter.listeners(type).length : emitter.listenerCount(type);
|
|
3427
|
-
return count > 0;
|
|
3428
|
-
}
|
|
3429
|
-
|
|
3430
|
-
/**
|
|
3431
|
-
* Determine if the response headers have been sent.
|
|
3432
|
-
*
|
|
3433
|
-
* @param {object} res
|
|
3434
|
-
* @returns {boolean}
|
|
3435
|
-
* @private
|
|
3436
|
-
*/
|
|
3437
|
-
|
|
3438
|
-
function headersSent(res) {
|
|
3439
|
-
return typeof res.headersSent !== 'boolean' ? Boolean(res._header) : res.headersSent;
|
|
3440
|
-
}
|
|
3441
|
-
|
|
3442
|
-
/**
|
|
3443
|
-
* Normalize the index option into an array.
|
|
3444
|
-
*
|
|
3445
|
-
* @param {boolean|string|array} val
|
|
3446
|
-
* @param {string} name
|
|
3447
|
-
* @private
|
|
3448
|
-
*/
|
|
3449
|
-
|
|
3450
|
-
function normalizeList(val, name) {
|
|
3451
|
-
var list = [].concat(val || []);
|
|
3452
|
-
for (var i = 0; i < list.length; i++) {
|
|
3453
|
-
if (typeof list[i] !== 'string') {
|
|
3454
|
-
throw new TypeError(name + ' must be array of strings or false');
|
|
3455
|
-
}
|
|
3456
|
-
}
|
|
3457
|
-
return list;
|
|
3458
|
-
}
|
|
3459
|
-
|
|
3460
|
-
/**
|
|
3461
|
-
* Parse an HTTP Date into a number.
|
|
3462
|
-
*
|
|
3463
|
-
* @param {string} date
|
|
3464
|
-
* @private
|
|
3465
|
-
*/
|
|
3466
|
-
|
|
3467
|
-
function parseHttpDate(date) {
|
|
3468
|
-
var timestamp = date && Date.parse(date);
|
|
3469
|
-
return typeof timestamp === 'number' ? timestamp : NaN;
|
|
3470
|
-
}
|
|
3471
|
-
|
|
3472
|
-
/**
|
|
3473
|
-
* Parse a HTTP token list.
|
|
3474
|
-
*
|
|
3475
|
-
* @param {string} str
|
|
3476
|
-
* @private
|
|
3477
|
-
*/
|
|
3478
|
-
|
|
3479
|
-
function parseTokenList(str) {
|
|
3480
|
-
var end = 0;
|
|
3481
|
-
var list = [];
|
|
3482
|
-
var start = 0;
|
|
3483
|
-
|
|
3484
|
-
// gather tokens
|
|
3485
|
-
for (var i = 0, len = str.length; i < len; i++) {
|
|
3486
|
-
switch (str.charCodeAt(i)) {
|
|
3487
|
-
case 0x20:
|
|
3488
|
-
/* */
|
|
3489
|
-
if (start === end) {
|
|
3490
|
-
start = end = i + 1;
|
|
3491
|
-
}
|
|
3492
|
-
break;
|
|
3493
|
-
case 0x2c:
|
|
3494
|
-
/* , */
|
|
3495
|
-
if (start !== end) {
|
|
3496
|
-
list.push(str.substring(start, end));
|
|
3497
|
-
}
|
|
3498
|
-
start = end = i + 1;
|
|
3499
|
-
break;
|
|
3500
|
-
default:
|
|
3501
|
-
end = i + 1;
|
|
3502
|
-
break;
|
|
3503
|
-
}
|
|
3504
|
-
}
|
|
3505
|
-
|
|
3506
|
-
// final token
|
|
3507
|
-
if (start !== end) {
|
|
3508
|
-
list.push(str.substring(start, end));
|
|
3509
|
-
}
|
|
3510
|
-
return list;
|
|
3511
|
-
}
|
|
3512
|
-
|
|
3513
|
-
/**
|
|
3514
|
-
* Set an object of headers on a response.
|
|
3515
|
-
*
|
|
3516
|
-
* @param {object} res
|
|
3517
|
-
* @param {object} headers
|
|
3518
|
-
* @private
|
|
3519
|
-
*/
|
|
3520
|
-
|
|
3521
|
-
function setHeaders(res, headers) {
|
|
3522
|
-
var keys = Object.keys(headers);
|
|
3523
|
-
for (var i = 0; i < keys.length; i++) {
|
|
3524
|
-
var key = keys[i];
|
|
3525
|
-
res.setHeader(key, headers[key]);
|
|
3526
|
-
}
|
|
3527
|
-
}
|
|
3528
|
-
|
|
3529
|
-
/***/ }),
|
|
3530
|
-
|
|
3531
|
-
/***/ 796:
|
|
3532
|
-
/***/ ((module) => {
|
|
3533
|
-
|
|
3534
|
-
"use strict";
|
|
3535
|
-
module.exports = /*#__PURE__*/JSON.parse('{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}');
|
|
3536
|
-
|
|
3537
|
-
/***/ }),
|
|
3538
|
-
|
|
3539
|
-
/***/ 804:
|
|
3540
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
3541
|
-
|
|
3542
|
-
"use strict";
|
|
3543
|
-
/*!
|
|
3544
|
-
* serve-static
|
|
3545
|
-
* Copyright(c) 2010 Sencha Inc.
|
|
3546
|
-
* Copyright(c) 2011 TJ Holowaychuk
|
|
3547
|
-
* Copyright(c) 2014-2016 Douglas Christopher Wilson
|
|
3548
|
-
* MIT Licensed
|
|
3549
|
-
*/
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
/**
|
|
3554
|
-
* Module dependencies.
|
|
3555
|
-
* @private
|
|
3556
|
-
*/
|
|
3557
|
-
var encodeUrl = __webpack_require__(23);
|
|
3558
|
-
var escapeHtml = __webpack_require__(415);
|
|
3559
|
-
var parseUrl = __webpack_require__(252);
|
|
3560
|
-
var resolve = (__webpack_require__(928).resolve);
|
|
3561
|
-
var send = __webpack_require__(750);
|
|
3562
|
-
var url = __webpack_require__(16);
|
|
3563
|
-
|
|
3564
|
-
/**
|
|
3565
|
-
* Module exports.
|
|
3566
|
-
* @public
|
|
3567
|
-
*/
|
|
3568
|
-
|
|
3569
|
-
module.exports = serveStatic;
|
|
3570
|
-
module.exports.mime = send.mime;
|
|
3571
|
-
|
|
3572
|
-
/**
|
|
3573
|
-
* @param {string} root
|
|
3574
|
-
* @param {object} [options]
|
|
3575
|
-
* @return {function}
|
|
3576
|
-
* @public
|
|
3577
|
-
*/
|
|
3578
|
-
|
|
3579
|
-
function serveStatic(root, options) {
|
|
3580
|
-
if (!root) {
|
|
3581
|
-
throw new TypeError('root path required');
|
|
3582
|
-
}
|
|
3583
|
-
if (typeof root !== 'string') {
|
|
3584
|
-
throw new TypeError('root path must be a string');
|
|
3585
|
-
}
|
|
3586
|
-
|
|
3587
|
-
// copy options object
|
|
3588
|
-
var opts = Object.create(options || null);
|
|
3589
|
-
|
|
3590
|
-
// fall-though
|
|
3591
|
-
var fallthrough = opts.fallthrough !== false;
|
|
3592
|
-
|
|
3593
|
-
// default redirect
|
|
3594
|
-
var redirect = opts.redirect !== false;
|
|
3595
|
-
|
|
3596
|
-
// headers listener
|
|
3597
|
-
var setHeaders = opts.setHeaders;
|
|
3598
|
-
if (setHeaders && typeof setHeaders !== 'function') {
|
|
3599
|
-
throw new TypeError('option setHeaders must be function');
|
|
3600
|
-
}
|
|
3601
|
-
|
|
3602
|
-
// setup options for send
|
|
3603
|
-
opts.maxage = opts.maxage || opts.maxAge || 0;
|
|
3604
|
-
opts.root = resolve(root);
|
|
3605
|
-
|
|
3606
|
-
// construct directory listener
|
|
3607
|
-
var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
|
|
3608
|
-
return function serveStatic(req, res, next) {
|
|
3609
|
-
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
3610
|
-
if (fallthrough) {
|
|
3611
|
-
return next();
|
|
3612
|
-
}
|
|
3613
|
-
|
|
3614
|
-
// method not allowed
|
|
3615
|
-
res.statusCode = 405;
|
|
3616
|
-
res.setHeader('Allow', 'GET, HEAD');
|
|
3617
|
-
res.setHeader('Content-Length', '0');
|
|
3618
|
-
res.end();
|
|
3619
|
-
return;
|
|
3620
|
-
}
|
|
3621
|
-
var forwardError = !fallthrough;
|
|
3622
|
-
var originalUrl = parseUrl.original(req);
|
|
3623
|
-
var path = parseUrl(req).pathname;
|
|
3624
|
-
|
|
3625
|
-
// make sure redirect occurs at mount
|
|
3626
|
-
if (path === '/' && originalUrl.pathname.substr(-1) !== '/') {
|
|
3627
|
-
path = '';
|
|
3628
|
-
}
|
|
3629
|
-
|
|
3630
|
-
// create send stream
|
|
3631
|
-
var stream = send(req, path, opts);
|
|
3632
|
-
|
|
3633
|
-
// add directory handler
|
|
3634
|
-
stream.on('directory', onDirectory);
|
|
3635
|
-
|
|
3636
|
-
// add headers listener
|
|
3637
|
-
if (setHeaders) {
|
|
3638
|
-
stream.on('headers', setHeaders);
|
|
3639
|
-
}
|
|
3640
|
-
|
|
3641
|
-
// add file listener for fallthrough
|
|
3642
|
-
if (fallthrough) {
|
|
3643
|
-
stream.on('file', function onFile() {
|
|
3644
|
-
// once file is determined, always forward error
|
|
3645
|
-
forwardError = true;
|
|
3646
|
-
});
|
|
3647
|
-
}
|
|
3648
|
-
|
|
3649
|
-
// forward errors
|
|
3650
|
-
stream.on('error', function error(err) {
|
|
3651
|
-
if (forwardError || !(err.statusCode < 500)) {
|
|
3652
|
-
next(err);
|
|
3653
|
-
return;
|
|
3654
|
-
}
|
|
3655
|
-
next();
|
|
3656
|
-
});
|
|
3657
|
-
|
|
3658
|
-
// pipe
|
|
3659
|
-
stream.pipe(res);
|
|
3660
|
-
};
|
|
3661
|
-
}
|
|
3662
|
-
|
|
3663
|
-
/**
|
|
3664
|
-
* Collapse all leading slashes into a single slash
|
|
3665
|
-
* @private
|
|
3666
|
-
*/
|
|
3667
|
-
function collapseLeadingSlashes(str) {
|
|
3668
|
-
for (var i = 0; i < str.length; i++) {
|
|
3669
|
-
if (str.charCodeAt(i) !== 0x2f /* / */) {
|
|
3670
|
-
break;
|
|
3671
|
-
}
|
|
3672
|
-
}
|
|
3673
|
-
return i > 1 ? '/' + str.substr(i) : str;
|
|
3674
|
-
}
|
|
3675
|
-
|
|
3676
|
-
/**
|
|
3677
|
-
* Create a minimal HTML document.
|
|
3678
|
-
*
|
|
3679
|
-
* @param {string} title
|
|
3680
|
-
* @param {string} body
|
|
3681
|
-
* @private
|
|
3682
|
-
*/
|
|
3683
|
-
|
|
3684
|
-
function createHtmlDocument(title, body) {
|
|
3685
|
-
return '<!DOCTYPE html>\n' + '<html lang="en">\n' + '<head>\n' + '<meta charset="utf-8">\n' + '<title>' + title + '</title>\n' + '</head>\n' + '<body>\n' + '<pre>' + body + '</pre>\n' + '</body>\n' + '</html>\n';
|
|
3686
|
-
}
|
|
3687
|
-
|
|
3688
|
-
/**
|
|
3689
|
-
* Create a directory listener that just 404s.
|
|
3690
|
-
* @private
|
|
3691
|
-
*/
|
|
3692
|
-
|
|
3693
|
-
function createNotFoundDirectoryListener() {
|
|
3694
|
-
return function notFound() {
|
|
3695
|
-
this.error(404);
|
|
3696
|
-
};
|
|
3697
|
-
}
|
|
3698
|
-
|
|
3699
|
-
/**
|
|
3700
|
-
* Create a directory listener that performs a redirect.
|
|
3701
|
-
* @private
|
|
3702
|
-
*/
|
|
3703
|
-
|
|
3704
|
-
function createRedirectDirectoryListener() {
|
|
3705
|
-
return function redirect(res) {
|
|
3706
|
-
if (this.hasTrailingSlash()) {
|
|
3707
|
-
this.error(404);
|
|
3708
|
-
return;
|
|
3709
|
-
}
|
|
3710
|
-
|
|
3711
|
-
// get original URL
|
|
3712
|
-
var originalUrl = parseUrl.original(this.req);
|
|
3713
|
-
|
|
3714
|
-
// append trailing slash
|
|
3715
|
-
originalUrl.path = null;
|
|
3716
|
-
originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/');
|
|
3717
|
-
|
|
3718
|
-
// reformat the URL
|
|
3719
|
-
var loc = encodeUrl(url.format(originalUrl));
|
|
3720
|
-
var doc = createHtmlDocument('Redirecting', 'Redirecting to ' + escapeHtml(loc));
|
|
3721
|
-
|
|
3722
|
-
// send redirect response
|
|
3723
|
-
res.statusCode = 301;
|
|
3724
|
-
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
|
|
3725
|
-
res.setHeader('Content-Length', Buffer.byteLength(doc));
|
|
3726
|
-
res.setHeader('Content-Security-Policy', "default-src 'none'");
|
|
3727
|
-
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
3728
|
-
res.setHeader('Location', loc);
|
|
3729
|
-
res.end(doc);
|
|
3730
|
-
};
|
|
3731
|
-
}
|
|
3732
|
-
|
|
3733
|
-
/***/ }),
|
|
3734
|
-
|
|
3735
|
-
/***/ 811:
|
|
3736
|
-
/***/ ((module) => {
|
|
3737
|
-
|
|
3738
|
-
/**
|
|
3739
|
-
* Helpers.
|
|
3740
|
-
*/
|
|
3741
|
-
|
|
3742
|
-
var s = 1000;
|
|
3743
|
-
var m = s * 60;
|
|
3744
|
-
var h = m * 60;
|
|
3745
|
-
var d = h * 24;
|
|
3746
|
-
var w = d * 7;
|
|
3747
|
-
var y = d * 365.25;
|
|
3748
|
-
|
|
3749
|
-
/**
|
|
3750
|
-
* Parse or format the given `val`.
|
|
3751
|
-
*
|
|
3752
|
-
* Options:
|
|
3753
|
-
*
|
|
3754
|
-
* - `long` verbose formatting [false]
|
|
3755
|
-
*
|
|
3756
|
-
* @param {String|Number} val
|
|
3757
|
-
* @param {Object} [options]
|
|
3758
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
3759
|
-
* @return {String|Number}
|
|
3760
|
-
* @api public
|
|
3761
|
-
*/
|
|
3762
|
-
|
|
3763
|
-
module.exports = function (val, options) {
|
|
3764
|
-
options = options || {};
|
|
3765
|
-
var type = typeof val;
|
|
3766
|
-
if (type === 'string' && val.length > 0) {
|
|
3767
|
-
return parse(val);
|
|
3768
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
3769
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
3770
|
-
}
|
|
3771
|
-
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
3772
|
-
};
|
|
3773
|
-
|
|
3774
|
-
/**
|
|
3775
|
-
* Parse the given `str` and return milliseconds.
|
|
3776
|
-
*
|
|
3777
|
-
* @param {String} str
|
|
3778
|
-
* @return {Number}
|
|
3779
|
-
* @api private
|
|
3780
|
-
*/
|
|
3781
|
-
|
|
3782
|
-
function parse(str) {
|
|
3783
|
-
str = String(str);
|
|
3784
|
-
if (str.length > 100) {
|
|
3785
|
-
return;
|
|
3786
|
-
}
|
|
3787
|
-
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(str);
|
|
3788
|
-
if (!match) {
|
|
3789
|
-
return;
|
|
3790
|
-
}
|
|
3791
|
-
var n = parseFloat(match[1]);
|
|
3792
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
3793
|
-
switch (type) {
|
|
3794
|
-
case 'years':
|
|
3795
|
-
case 'year':
|
|
3796
|
-
case 'yrs':
|
|
3797
|
-
case 'yr':
|
|
3798
|
-
case 'y':
|
|
3799
|
-
return n * y;
|
|
3800
|
-
case 'weeks':
|
|
3801
|
-
case 'week':
|
|
3802
|
-
case 'w':
|
|
3803
|
-
return n * w;
|
|
3804
|
-
case 'days':
|
|
3805
|
-
case 'day':
|
|
3806
|
-
case 'd':
|
|
3807
|
-
return n * d;
|
|
3808
|
-
case 'hours':
|
|
3809
|
-
case 'hour':
|
|
3810
|
-
case 'hrs':
|
|
3811
|
-
case 'hr':
|
|
3812
|
-
case 'h':
|
|
3813
|
-
return n * h;
|
|
3814
|
-
case 'minutes':
|
|
3815
|
-
case 'minute':
|
|
3816
|
-
case 'mins':
|
|
3817
|
-
case 'min':
|
|
3818
|
-
case 'm':
|
|
3819
|
-
return n * m;
|
|
3820
|
-
case 'seconds':
|
|
3821
|
-
case 'second':
|
|
3822
|
-
case 'secs':
|
|
3823
|
-
case 'sec':
|
|
3824
|
-
case 's':
|
|
3825
|
-
return n * s;
|
|
3826
|
-
case 'milliseconds':
|
|
3827
|
-
case 'millisecond':
|
|
3828
|
-
case 'msecs':
|
|
3829
|
-
case 'msec':
|
|
3830
|
-
case 'ms':
|
|
3831
|
-
return n;
|
|
3832
|
-
default:
|
|
3833
|
-
return undefined;
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
|
|
3837
|
-
/**
|
|
3838
|
-
* Short format for `ms`.
|
|
3839
|
-
*
|
|
3840
|
-
* @param {Number} ms
|
|
3841
|
-
* @return {String}
|
|
3842
|
-
* @api private
|
|
3843
|
-
*/
|
|
3844
|
-
|
|
3845
|
-
function fmtShort(ms) {
|
|
3846
|
-
var msAbs = Math.abs(ms);
|
|
3847
|
-
if (msAbs >= d) {
|
|
3848
|
-
return Math.round(ms / d) + 'd';
|
|
3849
|
-
}
|
|
3850
|
-
if (msAbs >= h) {
|
|
3851
|
-
return Math.round(ms / h) + 'h';
|
|
3852
|
-
}
|
|
3853
|
-
if (msAbs >= m) {
|
|
3854
|
-
return Math.round(ms / m) + 'm';
|
|
3855
|
-
}
|
|
3856
|
-
if (msAbs >= s) {
|
|
3857
|
-
return Math.round(ms / s) + 's';
|
|
3858
|
-
}
|
|
3859
|
-
return ms + 'ms';
|
|
3860
|
-
}
|
|
3861
|
-
|
|
3862
|
-
/**
|
|
3863
|
-
* Long format for `ms`.
|
|
3864
|
-
*
|
|
3865
|
-
* @param {Number} ms
|
|
3866
|
-
* @return {String}
|
|
3867
|
-
* @api private
|
|
3868
|
-
*/
|
|
3869
|
-
|
|
3870
|
-
function fmtLong(ms) {
|
|
3871
|
-
var msAbs = Math.abs(ms);
|
|
3872
|
-
if (msAbs >= d) {
|
|
3873
|
-
return plural(ms, msAbs, d, 'day');
|
|
3874
|
-
}
|
|
3875
|
-
if (msAbs >= h) {
|
|
3876
|
-
return plural(ms, msAbs, h, 'hour');
|
|
3877
|
-
}
|
|
3878
|
-
if (msAbs >= m) {
|
|
3879
|
-
return plural(ms, msAbs, m, 'minute');
|
|
3880
|
-
}
|
|
3881
|
-
if (msAbs >= s) {
|
|
3882
|
-
return plural(ms, msAbs, s, 'second');
|
|
3883
|
-
}
|
|
3884
|
-
return ms + ' ms';
|
|
3885
|
-
}
|
|
3886
|
-
|
|
3887
|
-
/**
|
|
3888
|
-
* Pluralization helper.
|
|
3889
|
-
*/
|
|
3890
|
-
|
|
3891
|
-
function plural(ms, msAbs, n, name) {
|
|
3892
|
-
var isPlural = msAbs >= n * 1.5;
|
|
3893
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
3894
|
-
}
|
|
3895
|
-
|
|
3896
|
-
/***/ }),
|
|
3897
|
-
|
|
3898
|
-
/***/ 843:
|
|
3899
|
-
/***/ ((module, exports, __webpack_require__) => {
|
|
3900
|
-
|
|
3901
|
-
/**
|
|
3902
|
-
* This is the common logic for both the Node.js and web browser
|
|
3903
|
-
* implementations of `debug()`.
|
|
3904
|
-
*
|
|
3905
|
-
* Expose `debug()` as the module.
|
|
3906
|
-
*/
|
|
3907
|
-
|
|
3908
|
-
exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
|
|
3909
|
-
exports.coerce = coerce;
|
|
3910
|
-
exports.disable = disable;
|
|
3911
|
-
exports.enable = enable;
|
|
3912
|
-
exports.enabled = enabled;
|
|
3913
|
-
exports.humanize = __webpack_require__(849);
|
|
3914
|
-
|
|
3915
|
-
/**
|
|
3916
|
-
* The currently active debug mode names, and names to skip.
|
|
3917
|
-
*/
|
|
3918
|
-
|
|
3919
|
-
exports.names = [];
|
|
3920
|
-
exports.skips = [];
|
|
3921
|
-
|
|
3922
|
-
/**
|
|
3923
|
-
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
3924
|
-
*
|
|
3925
|
-
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
3926
|
-
*/
|
|
3927
|
-
|
|
3928
|
-
exports.formatters = {};
|
|
3929
|
-
|
|
3930
|
-
/**
|
|
3931
|
-
* Previous log timestamp.
|
|
3932
|
-
*/
|
|
3933
|
-
|
|
3934
|
-
var prevTime;
|
|
3935
|
-
|
|
3936
|
-
/**
|
|
3937
|
-
* Select a color.
|
|
3938
|
-
* @param {String} namespace
|
|
3939
|
-
* @return {Number}
|
|
3940
|
-
* @api private
|
|
3941
|
-
*/
|
|
3942
|
-
|
|
3943
|
-
function selectColor(namespace) {
|
|
3944
|
-
var hash = 0,
|
|
3945
|
-
i;
|
|
3946
|
-
for (i in namespace) {
|
|
3947
|
-
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
3948
|
-
hash |= 0; // Convert to 32bit integer
|
|
3949
|
-
}
|
|
3950
|
-
return exports.colors[Math.abs(hash) % exports.colors.length];
|
|
3951
|
-
}
|
|
3952
|
-
|
|
3953
|
-
/**
|
|
3954
|
-
* Create a debugger with the given `namespace`.
|
|
3955
|
-
*
|
|
3956
|
-
* @param {String} namespace
|
|
3957
|
-
* @return {Function}
|
|
3958
|
-
* @api public
|
|
3959
|
-
*/
|
|
3960
|
-
|
|
3961
|
-
function createDebug(namespace) {
|
|
3962
|
-
function debug() {
|
|
3963
|
-
// disabled?
|
|
3964
|
-
if (!debug.enabled) return;
|
|
3965
|
-
var self = debug;
|
|
3966
|
-
|
|
3967
|
-
// set `diff` timestamp
|
|
3968
|
-
var curr = +new Date();
|
|
3969
|
-
var ms = curr - (prevTime || curr);
|
|
3970
|
-
self.diff = ms;
|
|
3971
|
-
self.prev = prevTime;
|
|
3972
|
-
self.curr = curr;
|
|
3973
|
-
prevTime = curr;
|
|
3974
|
-
|
|
3975
|
-
// turn the `arguments` into a proper Array
|
|
3976
|
-
var args = new Array(arguments.length);
|
|
3977
|
-
for (var i = 0; i < args.length; i++) {
|
|
3978
|
-
args[i] = arguments[i];
|
|
3979
|
-
}
|
|
3980
|
-
args[0] = exports.coerce(args[0]);
|
|
3981
|
-
if ('string' !== typeof args[0]) {
|
|
3982
|
-
// anything else let's inspect with %O
|
|
3983
|
-
args.unshift('%O');
|
|
3984
|
-
}
|
|
3985
|
-
|
|
3986
|
-
// apply any `formatters` transformations
|
|
3987
|
-
var index = 0;
|
|
3988
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
|
3989
|
-
// if we encounter an escaped % then don't increase the array index
|
|
3990
|
-
if (match === '%%') return match;
|
|
3991
|
-
index++;
|
|
3992
|
-
var formatter = exports.formatters[format];
|
|
3993
|
-
if ('function' === typeof formatter) {
|
|
3994
|
-
var val = args[index];
|
|
3995
|
-
match = formatter.call(self, val);
|
|
3996
|
-
|
|
3997
|
-
// now we need to remove `args[index]` since it's inlined in the `format`
|
|
3998
|
-
args.splice(index, 1);
|
|
3999
|
-
index--;
|
|
4000
|
-
}
|
|
4001
|
-
return match;
|
|
4002
|
-
});
|
|
4003
|
-
|
|
4004
|
-
// apply env-specific formatting (colors, etc.)
|
|
4005
|
-
exports.formatArgs.call(self, args);
|
|
4006
|
-
var logFn = debug.log || exports.log || console.log.bind(console);
|
|
4007
|
-
logFn.apply(self, args);
|
|
4008
|
-
}
|
|
4009
|
-
debug.namespace = namespace;
|
|
4010
|
-
debug.enabled = exports.enabled(namespace);
|
|
4011
|
-
debug.useColors = exports.useColors();
|
|
4012
|
-
debug.color = selectColor(namespace);
|
|
4013
|
-
|
|
4014
|
-
// env-specific initialization logic for debug instances
|
|
4015
|
-
if ('function' === typeof exports.init) {
|
|
4016
|
-
exports.init(debug);
|
|
4017
|
-
}
|
|
4018
|
-
return debug;
|
|
4019
|
-
}
|
|
4020
|
-
|
|
4021
|
-
/**
|
|
4022
|
-
* Enables a debug mode by namespaces. This can include modes
|
|
4023
|
-
* separated by a colon and wildcards.
|
|
4024
|
-
*
|
|
4025
|
-
* @param {String} namespaces
|
|
4026
|
-
* @api public
|
|
4027
|
-
*/
|
|
4028
|
-
|
|
4029
|
-
function enable(namespaces) {
|
|
4030
|
-
exports.save(namespaces);
|
|
4031
|
-
exports.names = [];
|
|
4032
|
-
exports.skips = [];
|
|
4033
|
-
var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
4034
|
-
var len = split.length;
|
|
4035
|
-
for (var i = 0; i < len; i++) {
|
|
4036
|
-
if (!split[i]) continue; // ignore empty strings
|
|
4037
|
-
namespaces = split[i].replace(/\*/g, '.*?');
|
|
4038
|
-
if (namespaces[0] === '-') {
|
|
4039
|
-
exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|
4040
|
-
} else {
|
|
4041
|
-
exports.names.push(new RegExp('^' + namespaces + '$'));
|
|
4042
|
-
}
|
|
4043
|
-
}
|
|
4044
|
-
}
|
|
4045
|
-
|
|
4046
|
-
/**
|
|
4047
|
-
* Disable debug output.
|
|
4048
|
-
*
|
|
4049
|
-
* @api public
|
|
4050
|
-
*/
|
|
4051
|
-
|
|
4052
|
-
function disable() {
|
|
4053
|
-
exports.enable('');
|
|
4054
|
-
}
|
|
4055
|
-
|
|
4056
|
-
/**
|
|
4057
|
-
* Returns true if the given mode name is enabled, false otherwise.
|
|
4058
|
-
*
|
|
4059
|
-
* @param {String} name
|
|
4060
|
-
* @return {Boolean}
|
|
4061
|
-
* @api public
|
|
4062
|
-
*/
|
|
4063
|
-
|
|
4064
|
-
function enabled(name) {
|
|
4065
|
-
var i, len;
|
|
4066
|
-
for (i = 0, len = exports.skips.length; i < len; i++) {
|
|
4067
|
-
if (exports.skips[i].test(name)) {
|
|
4068
|
-
return false;
|
|
4069
|
-
}
|
|
4070
|
-
}
|
|
4071
|
-
for (i = 0, len = exports.names.length; i < len; i++) {
|
|
4072
|
-
if (exports.names[i].test(name)) {
|
|
4073
|
-
return true;
|
|
4074
|
-
}
|
|
4075
|
-
}
|
|
4076
|
-
return false;
|
|
4077
|
-
}
|
|
4078
|
-
|
|
4079
|
-
/**
|
|
4080
|
-
* Coerce `val`.
|
|
4081
|
-
*
|
|
4082
|
-
* @param {Mixed} val
|
|
4083
|
-
* @return {Mixed}
|
|
4084
|
-
* @api private
|
|
4085
|
-
*/
|
|
4086
|
-
|
|
4087
|
-
function coerce(val) {
|
|
4088
|
-
if (val instanceof Error) return val.stack || val.message;
|
|
4089
|
-
return val;
|
|
4090
|
-
}
|
|
4091
|
-
|
|
4092
|
-
/***/ }),
|
|
4093
|
-
|
|
4094
|
-
/***/ 849:
|
|
4095
|
-
/***/ ((module) => {
|
|
4096
|
-
|
|
4097
|
-
/**
|
|
4098
|
-
* Helpers.
|
|
4099
|
-
*/
|
|
4100
|
-
|
|
4101
|
-
var s = 1000;
|
|
4102
|
-
var m = s * 60;
|
|
4103
|
-
var h = m * 60;
|
|
4104
|
-
var d = h * 24;
|
|
4105
|
-
var y = d * 365.25;
|
|
4106
|
-
|
|
4107
|
-
/**
|
|
4108
|
-
* Parse or format the given `val`.
|
|
4109
|
-
*
|
|
4110
|
-
* Options:
|
|
4111
|
-
*
|
|
4112
|
-
* - `long` verbose formatting [false]
|
|
4113
|
-
*
|
|
4114
|
-
* @param {String|Number} val
|
|
4115
|
-
* @param {Object} [options]
|
|
4116
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
4117
|
-
* @return {String|Number}
|
|
4118
|
-
* @api public
|
|
4119
|
-
*/
|
|
4120
|
-
|
|
4121
|
-
module.exports = function (val, options) {
|
|
4122
|
-
options = options || {};
|
|
4123
|
-
var type = typeof val;
|
|
4124
|
-
if (type === 'string' && val.length > 0) {
|
|
4125
|
-
return parse(val);
|
|
4126
|
-
} else if (type === 'number' && isNaN(val) === false) {
|
|
4127
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
4128
|
-
}
|
|
4129
|
-
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
4130
|
-
};
|
|
4131
|
-
|
|
4132
|
-
/**
|
|
4133
|
-
* Parse the given `str` and return milliseconds.
|
|
4134
|
-
*
|
|
4135
|
-
* @param {String} str
|
|
4136
|
-
* @return {Number}
|
|
4137
|
-
* @api private
|
|
4138
|
-
*/
|
|
4139
|
-
|
|
4140
|
-
function parse(str) {
|
|
4141
|
-
str = String(str);
|
|
4142
|
-
if (str.length > 100) {
|
|
4143
|
-
return;
|
|
4144
|
-
}
|
|
4145
|
-
var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
|
|
4146
|
-
if (!match) {
|
|
4147
|
-
return;
|
|
4148
|
-
}
|
|
4149
|
-
var n = parseFloat(match[1]);
|
|
4150
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
4151
|
-
switch (type) {
|
|
4152
|
-
case 'years':
|
|
4153
|
-
case 'year':
|
|
4154
|
-
case 'yrs':
|
|
4155
|
-
case 'yr':
|
|
4156
|
-
case 'y':
|
|
4157
|
-
return n * y;
|
|
4158
|
-
case 'days':
|
|
4159
|
-
case 'day':
|
|
4160
|
-
case 'd':
|
|
4161
|
-
return n * d;
|
|
4162
|
-
case 'hours':
|
|
4163
|
-
case 'hour':
|
|
4164
|
-
case 'hrs':
|
|
4165
|
-
case 'hr':
|
|
4166
|
-
case 'h':
|
|
4167
|
-
return n * h;
|
|
4168
|
-
case 'minutes':
|
|
4169
|
-
case 'minute':
|
|
4170
|
-
case 'mins':
|
|
4171
|
-
case 'min':
|
|
4172
|
-
case 'm':
|
|
4173
|
-
return n * m;
|
|
4174
|
-
case 'seconds':
|
|
4175
|
-
case 'second':
|
|
4176
|
-
case 'secs':
|
|
4177
|
-
case 'sec':
|
|
4178
|
-
case 's':
|
|
4179
|
-
return n * s;
|
|
4180
|
-
case 'milliseconds':
|
|
4181
|
-
case 'millisecond':
|
|
4182
|
-
case 'msecs':
|
|
4183
|
-
case 'msec':
|
|
4184
|
-
case 'ms':
|
|
4185
|
-
return n;
|
|
4186
|
-
default:
|
|
4187
|
-
return undefined;
|
|
4188
|
-
}
|
|
4189
|
-
}
|
|
4190
|
-
|
|
4191
|
-
/**
|
|
4192
|
-
* Short format for `ms`.
|
|
4193
|
-
*
|
|
4194
|
-
* @param {Number} ms
|
|
4195
|
-
* @return {String}
|
|
4196
|
-
* @api private
|
|
4197
|
-
*/
|
|
4198
|
-
|
|
4199
|
-
function fmtShort(ms) {
|
|
4200
|
-
if (ms >= d) {
|
|
4201
|
-
return Math.round(ms / d) + 'd';
|
|
4202
|
-
}
|
|
4203
|
-
if (ms >= h) {
|
|
4204
|
-
return Math.round(ms / h) + 'h';
|
|
4205
|
-
}
|
|
4206
|
-
if (ms >= m) {
|
|
4207
|
-
return Math.round(ms / m) + 'm';
|
|
4208
|
-
}
|
|
4209
|
-
if (ms >= s) {
|
|
4210
|
-
return Math.round(ms / s) + 's';
|
|
4211
|
-
}
|
|
4212
|
-
return ms + 'ms';
|
|
4213
|
-
}
|
|
4214
|
-
|
|
4215
|
-
/**
|
|
4216
|
-
* Long format for `ms`.
|
|
4217
|
-
*
|
|
4218
|
-
* @param {Number} ms
|
|
4219
|
-
* @return {String}
|
|
4220
|
-
* @api private
|
|
4221
|
-
*/
|
|
4222
|
-
|
|
4223
|
-
function fmtLong(ms) {
|
|
4224
|
-
return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
|
|
4225
|
-
}
|
|
4226
|
-
|
|
4227
|
-
/**
|
|
4228
|
-
* Pluralization helper.
|
|
4229
|
-
*/
|
|
4230
|
-
|
|
4231
|
-
function plural(ms, n, name) {
|
|
4232
|
-
if (ms < n) {
|
|
4233
|
-
return;
|
|
4234
|
-
}
|
|
4235
|
-
if (ms < n * 1.5) {
|
|
4236
|
-
return Math.floor(ms / n) + ' ' + name;
|
|
4237
|
-
}
|
|
4238
|
-
return Math.ceil(ms / n) + ' ' + name + 's';
|
|
4239
|
-
}
|
|
4240
|
-
|
|
4241
|
-
/***/ }),
|
|
4242
|
-
|
|
4243
|
-
/***/ 896:
|
|
4244
|
-
/***/ ((module) => {
|
|
4245
|
-
|
|
4246
|
-
"use strict";
|
|
4247
|
-
module.exports = require("fs");
|
|
4248
|
-
|
|
4249
|
-
/***/ }),
|
|
4250
|
-
|
|
4251
|
-
/***/ 900:
|
|
4252
|
-
/***/ ((module) => {
|
|
4253
|
-
|
|
4254
|
-
"use strict";
|
|
4255
|
-
module.exports = /*#__PURE__*/JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}');
|
|
4256
|
-
|
|
4257
|
-
/***/ }),
|
|
4258
|
-
|
|
4259
|
-
/***/ 928:
|
|
4260
|
-
/***/ ((module) => {
|
|
4261
|
-
|
|
4262
|
-
"use strict";
|
|
4263
|
-
module.exports = require("path");
|
|
4264
|
-
|
|
4265
|
-
/***/ }),
|
|
4266
|
-
|
|
4267
|
-
/***/ 959:
|
|
4268
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
4269
|
-
|
|
4270
|
-
/*!
|
|
4271
|
-
* depd
|
|
4272
|
-
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
4273
|
-
* MIT Licensed
|
|
4274
|
-
*/
|
|
4275
|
-
|
|
4276
|
-
/**
|
|
4277
|
-
* Module dependencies.
|
|
4278
|
-
*/
|
|
4279
|
-
|
|
4280
|
-
var relative = (__webpack_require__(928).relative);
|
|
4281
|
-
|
|
4282
|
-
/**
|
|
4283
|
-
* Module exports.
|
|
4284
|
-
*/
|
|
4285
|
-
|
|
4286
|
-
module.exports = depd;
|
|
4287
|
-
|
|
4288
|
-
/**
|
|
4289
|
-
* Get the path to base files on.
|
|
4290
|
-
*/
|
|
4291
|
-
|
|
4292
|
-
var basePath = process.cwd();
|
|
4293
|
-
|
|
4294
|
-
/**
|
|
4295
|
-
* Determine if namespace is contained in the string.
|
|
4296
|
-
*/
|
|
4297
|
-
|
|
4298
|
-
function containsNamespace(str, namespace) {
|
|
4299
|
-
var vals = str.split(/[ ,]+/);
|
|
4300
|
-
var ns = String(namespace).toLowerCase();
|
|
4301
|
-
for (var i = 0; i < vals.length; i++) {
|
|
4302
|
-
var val = vals[i];
|
|
4303
|
-
|
|
4304
|
-
// namespace contained
|
|
4305
|
-
if (val && (val === '*' || val.toLowerCase() === ns)) {
|
|
4306
|
-
return true;
|
|
4307
|
-
}
|
|
4308
|
-
}
|
|
4309
|
-
return false;
|
|
4310
|
-
}
|
|
4311
|
-
|
|
4312
|
-
/**
|
|
4313
|
-
* Convert a data descriptor to accessor descriptor.
|
|
4314
|
-
*/
|
|
4315
|
-
|
|
4316
|
-
function convertDataDescriptorToAccessor(obj, prop, message) {
|
|
4317
|
-
var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
4318
|
-
var value = descriptor.value;
|
|
4319
|
-
descriptor.get = function getter() {
|
|
4320
|
-
return value;
|
|
4321
|
-
};
|
|
4322
|
-
if (descriptor.writable) {
|
|
4323
|
-
descriptor.set = function setter(val) {
|
|
4324
|
-
return value = val;
|
|
4325
|
-
};
|
|
4326
|
-
}
|
|
4327
|
-
delete descriptor.value;
|
|
4328
|
-
delete descriptor.writable;
|
|
4329
|
-
Object.defineProperty(obj, prop, descriptor);
|
|
4330
|
-
return descriptor;
|
|
4331
|
-
}
|
|
4332
|
-
|
|
4333
|
-
/**
|
|
4334
|
-
* Create arguments string to keep arity.
|
|
4335
|
-
*/
|
|
4336
|
-
|
|
4337
|
-
function createArgumentsString(arity) {
|
|
4338
|
-
var str = '';
|
|
4339
|
-
for (var i = 0; i < arity; i++) {
|
|
4340
|
-
str += ', arg' + i;
|
|
4341
|
-
}
|
|
4342
|
-
return str.substr(2);
|
|
4343
|
-
}
|
|
4344
|
-
|
|
4345
|
-
/**
|
|
4346
|
-
* Create stack string from stack.
|
|
4347
|
-
*/
|
|
4348
|
-
|
|
4349
|
-
function createStackString(stack) {
|
|
4350
|
-
var str = this.name + ': ' + this.namespace;
|
|
4351
|
-
if (this.message) {
|
|
4352
|
-
str += ' deprecated ' + this.message;
|
|
4353
|
-
}
|
|
4354
|
-
for (var i = 0; i < stack.length; i++) {
|
|
4355
|
-
str += '\n at ' + stack[i].toString();
|
|
4356
|
-
}
|
|
4357
|
-
return str;
|
|
4358
|
-
}
|
|
4359
|
-
|
|
4360
|
-
/**
|
|
4361
|
-
* Create deprecate for namespace in caller.
|
|
4362
|
-
*/
|
|
4363
|
-
|
|
4364
|
-
function depd(namespace) {
|
|
4365
|
-
if (!namespace) {
|
|
4366
|
-
throw new TypeError('argument namespace is required');
|
|
4367
|
-
}
|
|
4368
|
-
var stack = getStack();
|
|
4369
|
-
var site = callSiteLocation(stack[1]);
|
|
4370
|
-
var file = site[0];
|
|
4371
|
-
function deprecate(message) {
|
|
4372
|
-
// call to self as log
|
|
4373
|
-
log.call(deprecate, message);
|
|
4374
|
-
}
|
|
4375
|
-
deprecate._file = file;
|
|
4376
|
-
deprecate._ignored = isignored(namespace);
|
|
4377
|
-
deprecate._namespace = namespace;
|
|
4378
|
-
deprecate._traced = istraced(namespace);
|
|
4379
|
-
deprecate._warned = Object.create(null);
|
|
4380
|
-
deprecate.function = wrapfunction;
|
|
4381
|
-
deprecate.property = wrapproperty;
|
|
4382
|
-
return deprecate;
|
|
4383
|
-
}
|
|
4384
|
-
|
|
4385
|
-
/**
|
|
4386
|
-
* Determine if event emitter has listeners of a given type.
|
|
4387
|
-
*
|
|
4388
|
-
* The way to do this check is done three different ways in Node.js >= 0.8
|
|
4389
|
-
* so this consolidates them into a minimal set using instance methods.
|
|
4390
|
-
*
|
|
4391
|
-
* @param {EventEmitter} emitter
|
|
4392
|
-
* @param {string} type
|
|
4393
|
-
* @returns {boolean}
|
|
4394
|
-
* @private
|
|
4395
|
-
*/
|
|
4396
|
-
|
|
4397
|
-
function eehaslisteners(emitter, type) {
|
|
4398
|
-
var count = typeof emitter.listenerCount !== 'function' ? emitter.listeners(type).length : emitter.listenerCount(type);
|
|
4399
|
-
return count > 0;
|
|
4400
|
-
}
|
|
4401
|
-
|
|
4402
|
-
/**
|
|
4403
|
-
* Determine if namespace is ignored.
|
|
4404
|
-
*/
|
|
4405
|
-
|
|
4406
|
-
function isignored(namespace) {
|
|
4407
|
-
if (process.noDeprecation) {
|
|
4408
|
-
// --no-deprecation support
|
|
4409
|
-
return true;
|
|
4410
|
-
}
|
|
4411
|
-
var str = process.env.NO_DEPRECATION || '';
|
|
4412
|
-
|
|
4413
|
-
// namespace ignored
|
|
4414
|
-
return containsNamespace(str, namespace);
|
|
4415
|
-
}
|
|
4416
|
-
|
|
4417
|
-
/**
|
|
4418
|
-
* Determine if namespace is traced.
|
|
4419
|
-
*/
|
|
4420
|
-
|
|
4421
|
-
function istraced(namespace) {
|
|
4422
|
-
if (process.traceDeprecation) {
|
|
4423
|
-
// --trace-deprecation support
|
|
4424
|
-
return true;
|
|
4425
|
-
}
|
|
4426
|
-
var str = process.env.TRACE_DEPRECATION || '';
|
|
4427
|
-
|
|
4428
|
-
// namespace traced
|
|
4429
|
-
return containsNamespace(str, namespace);
|
|
4430
|
-
}
|
|
4431
|
-
|
|
4432
|
-
/**
|
|
4433
|
-
* Display deprecation message.
|
|
4434
|
-
*/
|
|
4435
|
-
|
|
4436
|
-
function log(message, site) {
|
|
4437
|
-
var haslisteners = eehaslisteners(process, 'deprecation');
|
|
4438
|
-
|
|
4439
|
-
// abort early if no destination
|
|
4440
|
-
if (!haslisteners && this._ignored) {
|
|
4441
|
-
return;
|
|
4442
|
-
}
|
|
4443
|
-
var caller;
|
|
4444
|
-
var callFile;
|
|
4445
|
-
var callSite;
|
|
4446
|
-
var depSite;
|
|
4447
|
-
var i = 0;
|
|
4448
|
-
var seen = false;
|
|
4449
|
-
var stack = getStack();
|
|
4450
|
-
var file = this._file;
|
|
4451
|
-
if (site) {
|
|
4452
|
-
// provided site
|
|
4453
|
-
depSite = site;
|
|
4454
|
-
callSite = callSiteLocation(stack[1]);
|
|
4455
|
-
callSite.name = depSite.name;
|
|
4456
|
-
file = callSite[0];
|
|
4457
|
-
} else {
|
|
4458
|
-
// get call site
|
|
4459
|
-
i = 2;
|
|
4460
|
-
depSite = callSiteLocation(stack[i]);
|
|
4461
|
-
callSite = depSite;
|
|
4462
|
-
}
|
|
4463
|
-
|
|
4464
|
-
// get caller of deprecated thing in relation to file
|
|
4465
|
-
for (; i < stack.length; i++) {
|
|
4466
|
-
caller = callSiteLocation(stack[i]);
|
|
4467
|
-
callFile = caller[0];
|
|
4468
|
-
if (callFile === file) {
|
|
4469
|
-
seen = true;
|
|
4470
|
-
} else if (callFile === this._file) {
|
|
4471
|
-
file = this._file;
|
|
4472
|
-
} else if (seen) {
|
|
4473
|
-
break;
|
|
4474
|
-
}
|
|
4475
|
-
}
|
|
4476
|
-
var key = caller ? depSite.join(':') + '__' + caller.join(':') : undefined;
|
|
4477
|
-
if (key !== undefined && key in this._warned) {
|
|
4478
|
-
// already warned
|
|
4479
|
-
return;
|
|
4480
|
-
}
|
|
4481
|
-
this._warned[key] = true;
|
|
4482
|
-
|
|
4483
|
-
// generate automatic message from call site
|
|
4484
|
-
var msg = message;
|
|
4485
|
-
if (!msg) {
|
|
4486
|
-
msg = callSite === depSite || !callSite.name ? defaultMessage(depSite) : defaultMessage(callSite);
|
|
4487
|
-
}
|
|
4488
|
-
|
|
4489
|
-
// emit deprecation if listeners exist
|
|
4490
|
-
if (haslisteners) {
|
|
4491
|
-
var err = DeprecationError(this._namespace, msg, stack.slice(i));
|
|
4492
|
-
process.emit('deprecation', err);
|
|
4493
|
-
return;
|
|
4494
|
-
}
|
|
4495
|
-
|
|
4496
|
-
// format and write message
|
|
4497
|
-
var format = process.stderr.isTTY ? formatColor : formatPlain;
|
|
4498
|
-
var output = format.call(this, msg, caller, stack.slice(i));
|
|
4499
|
-
process.stderr.write(output + '\n', 'utf8');
|
|
4500
|
-
}
|
|
4501
|
-
|
|
4502
|
-
/**
|
|
4503
|
-
* Get call site location as array.
|
|
4504
|
-
*/
|
|
4505
|
-
|
|
4506
|
-
function callSiteLocation(callSite) {
|
|
4507
|
-
var file = callSite.getFileName() || '<anonymous>';
|
|
4508
|
-
var line = callSite.getLineNumber();
|
|
4509
|
-
var colm = callSite.getColumnNumber();
|
|
4510
|
-
if (callSite.isEval()) {
|
|
4511
|
-
file = callSite.getEvalOrigin() + ', ' + file;
|
|
4512
|
-
}
|
|
4513
|
-
var site = [file, line, colm];
|
|
4514
|
-
site.callSite = callSite;
|
|
4515
|
-
site.name = callSite.getFunctionName();
|
|
4516
|
-
return site;
|
|
4517
|
-
}
|
|
4518
|
-
|
|
4519
|
-
/**
|
|
4520
|
-
* Generate a default message from the site.
|
|
4521
|
-
*/
|
|
4522
|
-
|
|
4523
|
-
function defaultMessage(site) {
|
|
4524
|
-
var callSite = site.callSite;
|
|
4525
|
-
var funcName = site.name;
|
|
4526
|
-
|
|
4527
|
-
// make useful anonymous name
|
|
4528
|
-
if (!funcName) {
|
|
4529
|
-
funcName = '<anonymous@' + formatLocation(site) + '>';
|
|
4530
|
-
}
|
|
4531
|
-
var context = callSite.getThis();
|
|
4532
|
-
var typeName = context && callSite.getTypeName();
|
|
4533
|
-
|
|
4534
|
-
// ignore useless type name
|
|
4535
|
-
if (typeName === 'Object') {
|
|
4536
|
-
typeName = undefined;
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
|
-
// make useful type name
|
|
4540
|
-
if (typeName === 'Function') {
|
|
4541
|
-
typeName = context.name || typeName;
|
|
4542
|
-
}
|
|
4543
|
-
return typeName && callSite.getMethodName() ? typeName + '.' + funcName : funcName;
|
|
4544
|
-
}
|
|
4545
|
-
|
|
4546
|
-
/**
|
|
4547
|
-
* Format deprecation message without color.
|
|
4548
|
-
*/
|
|
4549
|
-
|
|
4550
|
-
function formatPlain(msg, caller, stack) {
|
|
4551
|
-
var timestamp = new Date().toUTCString();
|
|
4552
|
-
var formatted = timestamp + ' ' + this._namespace + ' deprecated ' + msg;
|
|
4553
|
-
|
|
4554
|
-
// add stack trace
|
|
4555
|
-
if (this._traced) {
|
|
4556
|
-
for (var i = 0; i < stack.length; i++) {
|
|
4557
|
-
formatted += '\n at ' + stack[i].toString();
|
|
4558
|
-
}
|
|
4559
|
-
return formatted;
|
|
4560
|
-
}
|
|
4561
|
-
if (caller) {
|
|
4562
|
-
formatted += ' at ' + formatLocation(caller);
|
|
4563
|
-
}
|
|
4564
|
-
return formatted;
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
|
-
/**
|
|
4568
|
-
* Format deprecation message with color.
|
|
4569
|
-
*/
|
|
4570
|
-
|
|
4571
|
-
function formatColor(msg, caller, stack) {
|
|
4572
|
-
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' +
|
|
4573
|
-
// bold cyan
|
|
4574
|
-
' \x1b[33;1mdeprecated\x1b[22;39m' +
|
|
4575
|
-
// bold yellow
|
|
4576
|
-
' \x1b[0m' + msg + '\x1b[39m'; // reset
|
|
4577
|
-
|
|
4578
|
-
// add stack trace
|
|
4579
|
-
if (this._traced) {
|
|
4580
|
-
for (var i = 0; i < stack.length; i++) {
|
|
4581
|
-
formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m'; // cyan
|
|
4582
|
-
}
|
|
4583
|
-
return formatted;
|
|
4584
|
-
}
|
|
4585
|
-
if (caller) {
|
|
4586
|
-
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m'; // cyan
|
|
4587
|
-
}
|
|
4588
|
-
return formatted;
|
|
4589
|
-
}
|
|
4590
|
-
|
|
4591
|
-
/**
|
|
4592
|
-
* Format call site location.
|
|
4593
|
-
*/
|
|
4594
|
-
|
|
4595
|
-
function formatLocation(callSite) {
|
|
4596
|
-
return relative(basePath, callSite[0]) + ':' + callSite[1] + ':' + callSite[2];
|
|
4597
|
-
}
|
|
4598
|
-
|
|
4599
|
-
/**
|
|
4600
|
-
* Get the stack as array of call sites.
|
|
4601
|
-
*/
|
|
4602
|
-
|
|
4603
|
-
function getStack() {
|
|
4604
|
-
var limit = Error.stackTraceLimit;
|
|
4605
|
-
var obj = {};
|
|
4606
|
-
var prep = Error.prepareStackTrace;
|
|
4607
|
-
Error.prepareStackTrace = prepareObjectStackTrace;
|
|
4608
|
-
Error.stackTraceLimit = Math.max(10, limit);
|
|
4609
|
-
|
|
4610
|
-
// capture the stack
|
|
4611
|
-
Error.captureStackTrace(obj);
|
|
4612
|
-
|
|
4613
|
-
// slice this function off the top
|
|
4614
|
-
var stack = obj.stack.slice(1);
|
|
4615
|
-
Error.prepareStackTrace = prep;
|
|
4616
|
-
Error.stackTraceLimit = limit;
|
|
4617
|
-
return stack;
|
|
4618
|
-
}
|
|
4619
|
-
|
|
4620
|
-
/**
|
|
4621
|
-
* Capture call site stack from v8.
|
|
4622
|
-
*/
|
|
4623
|
-
|
|
4624
|
-
function prepareObjectStackTrace(obj, stack) {
|
|
4625
|
-
return stack;
|
|
4626
|
-
}
|
|
4627
|
-
|
|
4628
|
-
/**
|
|
4629
|
-
* Return a wrapped function in a deprecation message.
|
|
4630
|
-
*/
|
|
4631
|
-
|
|
4632
|
-
function wrapfunction(fn, message) {
|
|
4633
|
-
if (typeof fn !== 'function') {
|
|
4634
|
-
throw new TypeError('argument fn must be a function');
|
|
4635
|
-
}
|
|
4636
|
-
var args = createArgumentsString(fn.length);
|
|
4637
|
-
var stack = getStack();
|
|
4638
|
-
var site = callSiteLocation(stack[1]);
|
|
4639
|
-
site.name = fn.name;
|
|
4640
|
-
|
|
4641
|
-
// eslint-disable-next-line no-new-func
|
|
4642
|
-
var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site', '"use strict"\n' + 'return function (' + args + ') {' + 'log.call(deprecate, message, site)\n' + 'return fn.apply(this, arguments)\n' + '}')(fn, log, this, message, site);
|
|
4643
|
-
return deprecatedfn;
|
|
4644
|
-
}
|
|
4645
|
-
|
|
4646
|
-
/**
|
|
4647
|
-
* Wrap property in a deprecation message.
|
|
4648
|
-
*/
|
|
4649
|
-
|
|
4650
|
-
function wrapproperty(obj, prop, message) {
|
|
4651
|
-
if (!obj || typeof obj !== 'object' && typeof obj !== 'function') {
|
|
4652
|
-
throw new TypeError('argument obj must be object');
|
|
4653
|
-
}
|
|
4654
|
-
var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
|
|
4655
|
-
if (!descriptor) {
|
|
4656
|
-
throw new TypeError('must call property on owner object');
|
|
4657
|
-
}
|
|
4658
|
-
if (!descriptor.configurable) {
|
|
4659
|
-
throw new TypeError('property must be configurable');
|
|
4660
|
-
}
|
|
4661
|
-
var deprecate = this;
|
|
4662
|
-
var stack = getStack();
|
|
4663
|
-
var site = callSiteLocation(stack[1]);
|
|
4664
|
-
|
|
4665
|
-
// set site name
|
|
4666
|
-
site.name = prop;
|
|
4667
|
-
|
|
4668
|
-
// convert data descriptor
|
|
4669
|
-
if ('value' in descriptor) {
|
|
4670
|
-
descriptor = convertDataDescriptorToAccessor(obj, prop, message);
|
|
4671
|
-
}
|
|
4672
|
-
var get = descriptor.get;
|
|
4673
|
-
var set = descriptor.set;
|
|
4674
|
-
|
|
4675
|
-
// wrap getter
|
|
4676
|
-
if (typeof get === 'function') {
|
|
4677
|
-
descriptor.get = function getter() {
|
|
4678
|
-
log.call(deprecate, message, site);
|
|
4679
|
-
return get.apply(this, arguments);
|
|
4680
|
-
};
|
|
4681
|
-
}
|
|
4682
|
-
|
|
4683
|
-
// wrap setter
|
|
4684
|
-
if (typeof set === 'function') {
|
|
4685
|
-
descriptor.set = function setter() {
|
|
4686
|
-
log.call(deprecate, message, site);
|
|
4687
|
-
return set.apply(this, arguments);
|
|
4688
|
-
};
|
|
4689
|
-
}
|
|
4690
|
-
Object.defineProperty(obj, prop, descriptor);
|
|
4691
|
-
}
|
|
4692
|
-
|
|
4693
|
-
/**
|
|
4694
|
-
* Create DeprecationError for deprecation
|
|
4695
|
-
*/
|
|
4696
|
-
|
|
4697
|
-
function DeprecationError(namespace, message, stack) {
|
|
4698
|
-
var error = new Error();
|
|
4699
|
-
var stackString;
|
|
4700
|
-
Object.defineProperty(error, 'constructor', {
|
|
4701
|
-
value: DeprecationError
|
|
4702
|
-
});
|
|
4703
|
-
Object.defineProperty(error, 'message', {
|
|
4704
|
-
configurable: true,
|
|
4705
|
-
enumerable: false,
|
|
4706
|
-
value: message,
|
|
4707
|
-
writable: true
|
|
4708
|
-
});
|
|
4709
|
-
Object.defineProperty(error, 'name', {
|
|
4710
|
-
enumerable: false,
|
|
4711
|
-
configurable: true,
|
|
4712
|
-
value: 'DeprecationError',
|
|
4713
|
-
writable: true
|
|
4714
|
-
});
|
|
4715
|
-
Object.defineProperty(error, 'namespace', {
|
|
4716
|
-
configurable: true,
|
|
4717
|
-
enumerable: false,
|
|
4718
|
-
value: namespace,
|
|
4719
|
-
writable: true
|
|
4720
|
-
});
|
|
4721
|
-
Object.defineProperty(error, 'stack', {
|
|
4722
|
-
configurable: true,
|
|
4723
|
-
enumerable: false,
|
|
4724
|
-
get: function () {
|
|
4725
|
-
if (stackString !== undefined) {
|
|
4726
|
-
return stackString;
|
|
4727
|
-
}
|
|
4728
|
-
|
|
4729
|
-
// prepare stack trace
|
|
4730
|
-
return stackString = createStackString.call(this, stack);
|
|
4731
|
-
},
|
|
4732
|
-
set: function setter(val) {
|
|
4733
|
-
stackString = val;
|
|
4734
|
-
}
|
|
4735
|
-
});
|
|
4736
|
-
return error;
|
|
4737
|
-
}
|
|
4738
|
-
|
|
4739
|
-
/***/ }),
|
|
4740
|
-
|
|
4741
|
-
/***/ 982:
|
|
4742
|
-
/***/ ((module) => {
|
|
4743
|
-
|
|
4744
|
-
"use strict";
|
|
4745
|
-
module.exports = require("crypto");
|
|
4746
|
-
|
|
4747
|
-
/***/ }),
|
|
4748
|
-
|
|
4749
|
-
/***/ 987:
|
|
4750
|
-
/***/ ((module) => {
|
|
4751
|
-
|
|
4752
|
-
"use strict";
|
|
4753
|
-
/*!
|
|
4754
|
-
* encodeurl
|
|
4755
|
-
* Copyright(c) 2016 Douglas Christopher Wilson
|
|
4756
|
-
* MIT Licensed
|
|
4757
|
-
*/
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
/**
|
|
4762
|
-
* Module exports.
|
|
4763
|
-
* @public
|
|
4764
|
-
*/
|
|
4765
|
-
module.exports = encodeUrl;
|
|
4766
|
-
|
|
4767
|
-
/**
|
|
4768
|
-
* RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
|
|
4769
|
-
* and including invalid escape sequences.
|
|
4770
|
-
* @private
|
|
4771
|
-
*/
|
|
4772
|
-
|
|
4773
|
-
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g;
|
|
4774
|
-
|
|
4775
|
-
/**
|
|
4776
|
-
* RegExp to match unmatched surrogate pair.
|
|
4777
|
-
* @private
|
|
4778
|
-
*/
|
|
4779
|
-
|
|
4780
|
-
var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g;
|
|
4781
|
-
|
|
4782
|
-
/**
|
|
4783
|
-
* String to replace unmatched surrogate pair with.
|
|
4784
|
-
* @private
|
|
4785
|
-
*/
|
|
4786
|
-
|
|
4787
|
-
var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2';
|
|
4788
|
-
|
|
4789
|
-
/**
|
|
4790
|
-
* Encode a URL to a percent-encoded form, excluding already-encoded sequences.
|
|
4791
|
-
*
|
|
4792
|
-
* This function will take an already-encoded URL and encode all the non-URL
|
|
4793
|
-
* code points. This function will not encode the "%" character unless it is
|
|
4794
|
-
* not part of a valid sequence (`%20` will be left as-is, but `%foo` will
|
|
4795
|
-
* be encoded as `%25foo`).
|
|
4796
|
-
*
|
|
4797
|
-
* This encode is meant to be "safe" and does not throw errors. It will try as
|
|
4798
|
-
* hard as it can to properly encode the given URL, including replacing any raw,
|
|
4799
|
-
* unpaired surrogate pairs with the Unicode replacement character prior to
|
|
4800
|
-
* encoding.
|
|
4801
|
-
*
|
|
4802
|
-
* @param {string} url
|
|
4803
|
-
* @return {string}
|
|
4804
|
-
* @public
|
|
4805
|
-
*/
|
|
4806
|
-
|
|
4807
|
-
function encodeUrl(url) {
|
|
4808
|
-
return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE).replace(ENCODE_CHARS_REGEXP, encodeURI);
|
|
4809
|
-
}
|
|
4810
|
-
|
|
4811
|
-
/***/ })
|
|
4812
|
-
|
|
4813
|
-
/******/ });
|
|
4814
|
-
/************************************************************************/
|
|
4815
|
-
/******/ // The module cache
|
|
4816
|
-
/******/ var __webpack_module_cache__ = {};
|
|
4817
|
-
/******/
|
|
4818
|
-
/******/ // The require function
|
|
4819
|
-
/******/ function __webpack_require__(moduleId) {
|
|
4820
|
-
/******/ // Check if module is in cache
|
|
4821
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
4822
|
-
/******/ if (cachedModule !== undefined) {
|
|
4823
|
-
/******/ return cachedModule.exports;
|
|
4824
|
-
/******/ }
|
|
4825
|
-
/******/ // Create a new module (and put it into the cache)
|
|
4826
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
4827
|
-
/******/ // no module.id needed
|
|
4828
|
-
/******/ // no module.loaded needed
|
|
4829
|
-
/******/ exports: {}
|
|
4830
|
-
/******/ };
|
|
4831
|
-
/******/
|
|
4832
|
-
/******/ // Execute the module function
|
|
4833
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
4834
|
-
/******/
|
|
4835
|
-
/******/ // Return the exports of the module
|
|
4836
|
-
/******/ return module.exports;
|
|
4837
|
-
/******/ }
|
|
4838
|
-
/******/
|
|
4839
|
-
/************************************************************************/
|
|
4840
|
-
/******/
|
|
4841
|
-
/******/ // startup
|
|
4842
|
-
/******/ // Load entry module and return exports
|
|
4843
|
-
/******/ // This entry module is referenced by other modules so it can't be inlined
|
|
4844
|
-
/******/ var __webpack_exports__ = __webpack_require__(268);
|
|
4845
|
-
/******/ module.exports = __webpack_exports__;
|
|
4846
|
-
/******/
|
|
4847
|
-
/******/ })()
|
|
4848
|
-
;
|