@rsbuild/core 2.0.0-beta.6 → 2.0.0-beta.8
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/bin/rsbuild.js +13 -0
- package/compiled/chokidar/index.d.ts +197 -29
- package/compiled/chokidar/package.json +1 -1
- package/compiled/connect-next/index.d.ts +56 -0
- package/compiled/connect-next/license +26 -0
- package/compiled/connect-next/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/jiti/dist/babel.cjs +60 -60
- package/compiled/jiti/dist/jiti.cjs +2 -2
- package/compiled/postcss/index.js +1 -1
- package/compiled/postcss/lib/at-rule.d.ts +1 -1
- package/compiled/postcss/lib/comment.d.ts +1 -1
- package/compiled/postcss/lib/container.d.ts +1 -1
- package/compiled/postcss/lib/css-syntax-error.d.ts +1 -1
- package/compiled/postcss/lib/declaration.d.ts +1 -1
- package/compiled/postcss/lib/document.d.ts +1 -1
- package/compiled/postcss/lib/input.d.ts +1 -1
- package/compiled/postcss/lib/lazy-result.d.ts +1 -1
- package/compiled/postcss/lib/no-work-result.d.ts +1 -1
- package/compiled/postcss/lib/node.d.ts +1 -1
- package/compiled/postcss/lib/previous-map.d.ts +1 -1
- package/compiled/postcss/lib/processor.d.ts +1 -1
- package/compiled/postcss/lib/result.d.ts +1 -1
- package/compiled/postcss/lib/root.d.ts +1 -1
- package/compiled/postcss/lib/rule.d.ts +1 -1
- package/compiled/postcss/lib/stringifier.d.ts +1 -1
- package/compiled/postcss/lib/warning.d.ts +1 -1
- package/compiled/postcss/package.json +1 -1
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/index.d.ts +17 -1
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +0 -2
- package/compiled/rspack-manifest-plugin/index.d.ts +48 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/style-loader/index.js +37 -94
- package/compiled/style-loader/package.json +1 -1
- package/dist/{131.js → 958.js} +1125 -1083
- package/dist/chokidar.js +59 -57
- package/dist/client/hmr.js +2 -2
- package/dist/client/overlay.js +1 -1
- package/dist/connect-next.js +268 -0
- package/dist/{connect.js.LICENSE.txt → connect-next.js.LICENSE.txt} +3 -13
- package/dist/cors.js +2 -2
- package/dist/http-proxy-middleware.js +57 -552
- package/dist/index.js +1 -1
- package/dist/launch-editor-middleware.js +31 -15
- package/dist/manifest-plugin.js +18 -18
- package/dist/memfs.js +217 -756
- package/dist/{710.js → mrmime.js} +2 -1
- package/dist/open.js +36 -34
- package/dist/range-parser.js +2 -2
- package/dist/remapping.js +2 -2
- package/dist/rslib-runtime.js +3 -3
- package/dist/sirv.js +14 -14
- package/dist/src.js +510 -0
- package/dist/tinyglobby.js +114 -69
- package/dist/transformLoader.mjs +38 -1
- package/dist/transformRawLoader.mjs +1 -1
- package/dist/ws.js +1541 -0
- package/dist-types/helpers/index.d.ts +1 -1
- package/dist-types/helpers/vendors.d.ts +0 -1
- package/dist-types/server/runner/asModule.d.ts +1 -1
- package/dist-types/server/socketServer.d.ts +1 -1
- package/dist-types/types/config.d.ts +4 -4
- package/dist-types/types/thirdParty.d.ts +14 -5
- package/package.json +13 -14
- package/compiled/chokidar/handler.d.ts +0 -90
- package/compiled/ws/index.d.ts +0 -437
- package/compiled/ws/index.js +0 -3166
- package/compiled/ws/license +0 -20
- package/compiled/ws/package.json +0 -1
- package/dist/397.js +0 -11
- package/dist/7.js +0 -1
- package/dist/712.js +0 -15
- package/dist/743.js +0 -7
- package/dist/88.js +0 -40
- package/dist/connect.js +0 -570
- package/dist-types/helpers/color.d.ts +0 -4
- /package/dist/{131.js.LICENSE.txt → 958.js.LICENSE.txt} +0 -0
- /package/dist/client/{59.js → 797.js} +0 -0
- /package/dist/{31.js → trace-mapping.js} +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
/*! LICENSE: connect-next.js.LICENSE.txt */
|
|
2
|
+
import * as __rspack_external_url from "url";
|
|
3
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
+
import { EventEmitter } from "node:events";
|
|
5
|
+
import { Server, createServer } from "node:http";
|
|
6
|
+
import "./src.js";
|
|
7
|
+
import "./958.js";
|
|
8
|
+
__webpack_require__.add({
|
|
9
|
+
"../../node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js" (module) {
|
|
10
|
+
module.exports = encodeUrl;
|
|
11
|
+
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, UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g;
|
|
12
|
+
function encodeUrl(url) {
|
|
13
|
+
return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, '$1\uFFFD$2').replace(ENCODE_CHARS_REGEXP, encodeURI);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js" (module) {
|
|
17
|
+
var matchHtmlRegExp = /["'&<>]/;
|
|
18
|
+
module.exports = function escapeHtml(string) {
|
|
19
|
+
var escape, str = '' + string, match = matchHtmlRegExp.exec(str);
|
|
20
|
+
if (!match) return str;
|
|
21
|
+
var html = '', index = 0, lastIndex = 0;
|
|
22
|
+
for(index = match.index; index < str.length; index++){
|
|
23
|
+
switch(str.charCodeAt(index)){
|
|
24
|
+
case 34:
|
|
25
|
+
escape = '"';
|
|
26
|
+
break;
|
|
27
|
+
case 38:
|
|
28
|
+
escape = '&';
|
|
29
|
+
break;
|
|
30
|
+
case 39:
|
|
31
|
+
escape = ''';
|
|
32
|
+
break;
|
|
33
|
+
case 60:
|
|
34
|
+
escape = '<';
|
|
35
|
+
break;
|
|
36
|
+
case 62:
|
|
37
|
+
escape = '>';
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
lastIndex !== index && (html += str.substring(lastIndex, index)), lastIndex = index + 1, html += escape;
|
|
43
|
+
}
|
|
44
|
+
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
"../../node_modules/.pnpm/finalhandler@2.1.1_supports-color@10.2.2/node_modules/finalhandler/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
48
|
+
var debug = __webpack_require__("../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js")('finalhandler'), encodeUrl = __webpack_require__("../../node_modules/.pnpm/encodeurl@2.0.0/node_modules/encodeurl/index.js"), escapeHtml = __webpack_require__("../../node_modules/.pnpm/escape-html@1.0.3/node_modules/escape-html/index.js"), onFinished = __webpack_require__("../../node_modules/.pnpm/on-finished@2.4.1/node_modules/on-finished/index.js"), parseUrl = __webpack_require__("../../node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js"), statuses = __webpack_require__("../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js"), isFinished = onFinished.isFinished;
|
|
49
|
+
function createHtmlDocument(message) {
|
|
50
|
+
return '<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>Error</title>\n</head>\n<body>\n<pre>' + escapeHtml(message).replaceAll('\n', '<br>').replaceAll(' ', ' ') + "</pre>\n</body>\n</html>\n";
|
|
51
|
+
}
|
|
52
|
+
function getErrorHeaders(err) {
|
|
53
|
+
if (err.headers && 'object' == typeof err.headers) return {
|
|
54
|
+
...err.headers
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function getErrorMessage(err, status, env) {
|
|
58
|
+
var msg;
|
|
59
|
+
return 'production' !== env && ((msg = err.stack) || 'function' != typeof err.toString || (msg = err.toString())), msg || statuses.message[status];
|
|
60
|
+
}
|
|
61
|
+
function getErrorStatusCode(err) {
|
|
62
|
+
return 'number' == typeof err.status && err.status >= 400 && err.status < 600 ? err.status : 'number' == typeof err.statusCode && err.statusCode >= 400 && err.statusCode < 600 ? err.statusCode : void 0;
|
|
63
|
+
}
|
|
64
|
+
function getResourceName(req) {
|
|
65
|
+
try {
|
|
66
|
+
return parseUrl.original(req).pathname;
|
|
67
|
+
} catch (e) {
|
|
68
|
+
return 'resource';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function getResponseStatusCode(res) {
|
|
72
|
+
var status = res.statusCode;
|
|
73
|
+
return ('number' != typeof status || status < 400 || status > 599) && (status = 500), status;
|
|
74
|
+
}
|
|
75
|
+
function send(req, res, status, headers, message) {
|
|
76
|
+
function write() {
|
|
77
|
+
var body = createHtmlDocument(message);
|
|
78
|
+
for (let [key, value] of (res.statusCode = status, req.httpVersionMajor < 2 && (res.statusMessage = statuses.message[status]), res.removeHeader('Content-Encoding'), res.removeHeader('Content-Language'), res.removeHeader('Content-Range'), Object.entries(headers ?? {})))res.setHeader(key, value);
|
|
79
|
+
(res.setHeader('Content-Security-Policy', "default-src 'none'"), res.setHeader('X-Content-Type-Options', 'nosniff'), res.setHeader('Content-Type', 'text/html; charset=utf-8'), res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8')), 'HEAD' === req.method) ? res.end() : res.end(body, 'utf8');
|
|
80
|
+
}
|
|
81
|
+
isFinished(req) ? write() : (req.unpipe(), onFinished(req, write), req.resume());
|
|
82
|
+
}
|
|
83
|
+
module.exports = function finalhandler(req, res, options) {
|
|
84
|
+
var opts = options || {}, env = opts.env || process.env.NODE_ENV || 'development', onerror = opts.onerror;
|
|
85
|
+
return function(err) {
|
|
86
|
+
var headers, msg, status;
|
|
87
|
+
if (!err && res.headersSent) return void debug('cannot 404 after headers sent');
|
|
88
|
+
if (err ? (void 0 === (status = getErrorStatusCode(err)) ? status = getResponseStatusCode(res) : headers = getErrorHeaders(err), msg = getErrorMessage(err, status, env)) : (status = 404, msg = 'Cannot ' + req.method + ' ' + encodeUrl(getResourceName(req))), debug('default %s', status), err && onerror && setImmediate(onerror, err, req, res), res.headersSent) {
|
|
89
|
+
debug('cannot %d after headers sent', status), req.socket && req.socket.destroy();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
send(req, res, status, headers, msg);
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
"../../node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
97
|
+
var url = __webpack_require__("url?b138"), parse = url.parse, Url = url.Url;
|
|
98
|
+
function parseurl(req) {
|
|
99
|
+
var url = req.url;
|
|
100
|
+
if (void 0 !== url) {
|
|
101
|
+
var parsed = req._parsedUrl;
|
|
102
|
+
return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedUrl = parsed);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function originalurl(req) {
|
|
106
|
+
var url = req.originalUrl;
|
|
107
|
+
if ('string' != typeof url) return parseurl(req);
|
|
108
|
+
var parsed = req._parsedOriginalUrl;
|
|
109
|
+
return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedOriginalUrl = parsed);
|
|
110
|
+
}
|
|
111
|
+
function fastparse(str) {
|
|
112
|
+
if ('string' != typeof str || 0x2f !== str.charCodeAt(0)) return parse(str);
|
|
113
|
+
for(var pathname = str, query = null, search = null, i = 1; i < str.length; i++)switch(str.charCodeAt(i)){
|
|
114
|
+
case 0x3f:
|
|
115
|
+
null === search && (pathname = str.substring(0, i), query = str.substring(i + 1), search = str.substring(i));
|
|
116
|
+
break;
|
|
117
|
+
case 0x09:
|
|
118
|
+
case 0x0a:
|
|
119
|
+
case 0x0c:
|
|
120
|
+
case 0x0d:
|
|
121
|
+
case 0x20:
|
|
122
|
+
case 0x23:
|
|
123
|
+
case 0xa0:
|
|
124
|
+
case 0xfeff:
|
|
125
|
+
return parse(str);
|
|
126
|
+
}
|
|
127
|
+
var url = void 0 !== Url ? new Url() : {};
|
|
128
|
+
return url.path = str, url.href = str, url.pathname = pathname, null !== search && (url.query = query, url.search = search), url;
|
|
129
|
+
}
|
|
130
|
+
function fresh(url, parsedUrl) {
|
|
131
|
+
return 'object' == typeof parsedUrl && null !== parsedUrl && (void 0 === Url || parsedUrl instanceof Url) && parsedUrl._raw === url;
|
|
132
|
+
}
|
|
133
|
+
module.exports = parseurl, module.exports.original = originalurl;
|
|
134
|
+
},
|
|
135
|
+
"../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
136
|
+
var codes = __webpack_require__("../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json");
|
|
137
|
+
function createMessageToStatusCodeMap(codes) {
|
|
138
|
+
var map = {};
|
|
139
|
+
return Object.keys(codes).forEach(function forEachCode(code) {
|
|
140
|
+
var message = codes[code], status = Number(code);
|
|
141
|
+
map[message.toLowerCase()] = status;
|
|
142
|
+
}), map;
|
|
143
|
+
}
|
|
144
|
+
function createStatusCodeList(codes) {
|
|
145
|
+
return Object.keys(codes).map(function mapCode(code) {
|
|
146
|
+
return Number(code);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function getStatusCode(message) {
|
|
150
|
+
var msg = message.toLowerCase();
|
|
151
|
+
if (!Object.prototype.hasOwnProperty.call(status.code, msg)) throw Error('invalid status message: "' + message + '"');
|
|
152
|
+
return status.code[msg];
|
|
153
|
+
}
|
|
154
|
+
function getStatusMessage(code) {
|
|
155
|
+
if (!Object.prototype.hasOwnProperty.call(status.message, code)) throw Error('invalid status code: ' + code);
|
|
156
|
+
return status.message[code];
|
|
157
|
+
}
|
|
158
|
+
function status(code) {
|
|
159
|
+
if ('number' == typeof code) return getStatusMessage(code);
|
|
160
|
+
if ('string' != typeof code) throw TypeError('code must be a number or string');
|
|
161
|
+
var n = parseInt(code, 10);
|
|
162
|
+
return isNaN(n) ? getStatusCode(code) : getStatusMessage(n);
|
|
163
|
+
}
|
|
164
|
+
module.exports = status, status.message = codes, status.code = createMessageToStatusCodeMap(codes), status.codes = createStatusCodeList(codes), status.redirect = {
|
|
165
|
+
300: !0,
|
|
166
|
+
301: !0,
|
|
167
|
+
302: !0,
|
|
168
|
+
303: !0,
|
|
169
|
+
305: !0,
|
|
170
|
+
307: !0,
|
|
171
|
+
308: !0
|
|
172
|
+
}, status.empty = {
|
|
173
|
+
204: !0,
|
|
174
|
+
205: !0,
|
|
175
|
+
304: !0
|
|
176
|
+
}, status.retry = {
|
|
177
|
+
502: !0,
|
|
178
|
+
503: !0,
|
|
179
|
+
504: !0
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
"url?b138" (module) {
|
|
183
|
+
module.exports = __rspack_external_url;
|
|
184
|
+
},
|
|
185
|
+
"../../node_modules/.pnpm/statuses@2.0.2/node_modules/statuses/codes.json" (module) {
|
|
186
|
+
module.exports = 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"}');
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
let src = __webpack_require__("../../node_modules/.pnpm/debug@4.4.3_supports-color@10.2.2/node_modules/debug/src/index.js"), finalhandler = __webpack_require__("../../node_modules/.pnpm/finalhandler@2.1.1_supports-color@10.2.2/node_modules/finalhandler/index.js"), parseurl = __webpack_require__("../../node_modules/.pnpm/parseurl@1.3.3/node_modules/parseurl/index.js"), src_debug = src('connect:dispatcher'), env = process.env.NODE_ENV || 'development', defer = setImmediate;
|
|
190
|
+
function connect() {
|
|
191
|
+
let app = function(req, res, next) {
|
|
192
|
+
app.handle(req, res, next);
|
|
193
|
+
};
|
|
194
|
+
return Object.assign(app, proto), Object.assign(app, EventEmitter.prototype), app.route = '/', app.stack = [], app;
|
|
195
|
+
}
|
|
196
|
+
let proto = {
|
|
197
|
+
use (route, fn) {
|
|
198
|
+
let handle = fn, path = '/';
|
|
199
|
+
if ('string' == typeof route ? path = route : handle = route, void 0 === handle) throw TypeError('app.use() requires a middleware function');
|
|
200
|
+
if (isConnectServer(handle)) {
|
|
201
|
+
let server = handle;
|
|
202
|
+
server.route = path, handle = function(req, res, next) {
|
|
203
|
+
server.handle(req, res, next);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
if (isHttpServer(handle)) {
|
|
207
|
+
let requestListener = handle.listeners('request')[0];
|
|
208
|
+
if ('function' != typeof requestListener) throw TypeError('http.Server has no request listener');
|
|
209
|
+
handle = requestListener;
|
|
210
|
+
}
|
|
211
|
+
if (!isConnectHandle(handle)) throw TypeError('app.use() requires a middleware function');
|
|
212
|
+
return path.endsWith('/') && (path = path.slice(0, -1)), src_debug('use %s %s', path || '/', handle.name || 'anonymous'), this.stack.push({
|
|
213
|
+
route: path,
|
|
214
|
+
handle
|
|
215
|
+
}), this;
|
|
216
|
+
},
|
|
217
|
+
handle (req, res, out) {
|
|
218
|
+
let index = 0, protohost = getProtohost(req.url || '') || '', removed = '', slashAdded = !1, stack = this.stack, done = out ?? finalhandler(req, res, {
|
|
219
|
+
env: env,
|
|
220
|
+
onerror: logerror
|
|
221
|
+
});
|
|
222
|
+
function next(err) {
|
|
223
|
+
slashAdded && (req.url = (req.url || '').slice(1), slashAdded = !1), 0 !== removed.length && (req.url = protohost + removed + (req.url || '').slice(protohost.length), removed = '');
|
|
224
|
+
let layer = stack[index++];
|
|
225
|
+
if (!layer) return void defer(done, err);
|
|
226
|
+
let path = parseurl(req)?.pathname || '/', route = layer.route, lowerPath = path.toLowerCase(), lowerRoute = route.toLowerCase();
|
|
227
|
+
if (!lowerPath.startsWith(lowerRoute)) return void next(err);
|
|
228
|
+
let c = path.length > route.length ? path.charAt(route.length) : '';
|
|
229
|
+
'' !== c && '/' !== c && '.' !== c ? next(err) : (0 !== route.length && '/' !== route && (removed = route, req.url = protohost + (req.url || '').slice(protohost.length + removed.length), protohost || '/' === (req.url || '').charAt(0) || (req.url = '/' + (req.url || ''), slashAdded = !0)), call(layer.handle, route, err, req, res, next));
|
|
230
|
+
}
|
|
231
|
+
req.originalUrl = req.originalUrl || req.url, next();
|
|
232
|
+
},
|
|
233
|
+
listen (...args) {
|
|
234
|
+
return createServer(this).listen(...args);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
function call(handle, route, err, req, res, next) {
|
|
238
|
+
let arity = handle.length, error = err, hasError = void 0 !== err;
|
|
239
|
+
src_debug('%s %s : %s', handle.name || '<anonymous>', route, req.originalUrl);
|
|
240
|
+
try {
|
|
241
|
+
if (hasError && 4 === arity) return void handle(err, req, res, next);
|
|
242
|
+
if (!hasError && arity < 4) return void handle(req, res, next);
|
|
243
|
+
} catch (caughtError) {
|
|
244
|
+
error = caughtError;
|
|
245
|
+
}
|
|
246
|
+
next(error);
|
|
247
|
+
}
|
|
248
|
+
function logerror(err) {
|
|
249
|
+
if ('test' !== env) {
|
|
250
|
+
if (err instanceof Error) return void console.error(err.stack || err.toString());
|
|
251
|
+
console.error(String(err));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function getProtohost(url) {
|
|
255
|
+
if (0 === url.length || '/' === url[0]) return;
|
|
256
|
+
let fqdnIndex = url.indexOf('://');
|
|
257
|
+
return -1 !== fqdnIndex && -1 === url.lastIndexOf('?', fqdnIndex) ? url.slice(0, url.indexOf('/', 3 + fqdnIndex)) : void 0;
|
|
258
|
+
}
|
|
259
|
+
function isConnectHandle(value) {
|
|
260
|
+
return 'function' == typeof value;
|
|
261
|
+
}
|
|
262
|
+
function isConnectServer(value) {
|
|
263
|
+
return 'function' == typeof value && 'handle' in value && 'function' == typeof value.handle;
|
|
264
|
+
}
|
|
265
|
+
function isHttpServer(value) {
|
|
266
|
+
return value instanceof Server;
|
|
267
|
+
}
|
|
268
|
+
export { connect };
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright(c) 2010 Sencha Inc.
|
|
4
4
|
* Copyright(c) 2011 TJ Holowaychuk
|
|
5
5
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
6
|
+
* Copyright(c) 2025 Rstackjs
|
|
6
7
|
* MIT Licensed
|
|
7
8
|
*/
|
|
8
9
|
|
|
@@ -22,14 +23,7 @@
|
|
|
22
23
|
|
|
23
24
|
/*!
|
|
24
25
|
* finalhandler
|
|
25
|
-
* Copyright(c) 2014-
|
|
26
|
-
* MIT Licensed
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/*!
|
|
30
|
-
* on-finished
|
|
31
|
-
* Copyright(c) 2013 Jonathan Ong
|
|
32
|
-
* Copyright(c) 2014 Douglas Christopher Wilson
|
|
26
|
+
* Copyright(c) 2014-2022 Douglas Christopher Wilson
|
|
33
27
|
* MIT Licensed
|
|
34
28
|
*/
|
|
35
29
|
|
|
@@ -47,8 +41,4 @@
|
|
|
47
41
|
* MIT Licensed
|
|
48
42
|
*/
|
|
49
43
|
|
|
50
|
-
/*!
|
|
51
|
-
* unpipe
|
|
52
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
53
|
-
* MIT Licensed
|
|
54
|
-
*/
|
|
44
|
+
/*! For license information please see index.js.LICENSE.txt */
|
package/dist/cors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: cors.js.LICENSE.txt */
|
|
2
2
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
3
|
__webpack_require__.add({
|
|
4
4
|
"../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
@@ -185,4 +185,4 @@ __webpack_require__.add({
|
|
|
185
185
|
(val = append(Array.isArray(val) ? val.join(', ') : String(val), field)) && res.setHeader('Vary', val);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
});
|
|
188
|
+
}), __webpack_require__("../../node_modules/.pnpm/cors@2.8.6/node_modules/cors/lib/index.js");
|