@vercel/node 5.7.12 → 5.7.15

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.
@@ -881,7 +881,6 @@ import { createServer as createServer2 } from "http";
881
881
  // src/serverless-functions/helpers.ts
882
882
  var import_content_type = __toESM(require_content_type());
883
883
  import { PassThrough } from "stream";
884
- import { parse as parseURL } from "url";
885
884
  import { parse as parseQS } from "querystring";
886
885
  import etag from "etag";
887
886
  var ApiError = class extends Error {
@@ -920,7 +919,17 @@ function getBodyParser(body, contentType) {
920
919
  }
921
920
  function getQueryParser({ url = "/" }) {
922
921
  return function parseQuery() {
923
- return parseURL(url, true).query;
922
+ const urlObj = new URL(url, "http://localhost");
923
+ const query = {};
924
+ urlObj.searchParams.forEach((value, key) => {
925
+ const existing = query[key];
926
+ if (existing !== void 0) {
927
+ query[key] = Array.isArray(existing) ? [...existing, value] : [existing, value];
928
+ } else {
929
+ query[key] = value;
930
+ }
931
+ });
932
+ return query;
924
933
  };
925
934
  }
926
935
  function getCookieParser(req) {
package/dist/index.js CHANGED
@@ -36664,27 +36664,27 @@ var require_resolve_uri_umd = __commonJS({
36664
36664
  }
36665
36665
  function parseUrl(input) {
36666
36666
  if (isSchemeRelativeUrl(input)) {
36667
- const url3 = parseAbsoluteUrl("http:" + input);
36668
- url3.scheme = "";
36669
- url3.type = 6;
36670
- return url3;
36667
+ const url2 = parseAbsoluteUrl("http:" + input);
36668
+ url2.scheme = "";
36669
+ url2.type = 6;
36670
+ return url2;
36671
36671
  }
36672
36672
  if (isAbsolutePath(input)) {
36673
- const url3 = parseAbsoluteUrl("http://foo.com" + input);
36674
- url3.scheme = "";
36675
- url3.host = "";
36676
- url3.type = 5;
36677
- return url3;
36673
+ const url2 = parseAbsoluteUrl("http://foo.com" + input);
36674
+ url2.scheme = "";
36675
+ url2.host = "";
36676
+ url2.type = 5;
36677
+ return url2;
36678
36678
  }
36679
36679
  if (isFileUrl(input))
36680
36680
  return parseFileUrl(input);
36681
36681
  if (isAbsoluteUrl(input))
36682
36682
  return parseAbsoluteUrl(input);
36683
- const url2 = parseAbsoluteUrl("http://foo.com/" + input);
36684
- url2.scheme = "";
36685
- url2.host = "";
36686
- url2.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
36687
- return url2;
36683
+ const url = parseAbsoluteUrl("http://foo.com/" + input);
36684
+ url.scheme = "";
36685
+ url.host = "";
36686
+ url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
36687
+ return url;
36688
36688
  }
36689
36689
  function stripPathFilename(path) {
36690
36690
  if (path.endsWith("/.."))
@@ -36692,17 +36692,17 @@ var require_resolve_uri_umd = __commonJS({
36692
36692
  const index = path.lastIndexOf("/");
36693
36693
  return path.slice(0, index + 1);
36694
36694
  }
36695
- function mergePaths(url2, base) {
36695
+ function mergePaths(url, base) {
36696
36696
  normalizePath(base, base.type);
36697
- if (url2.path === "/") {
36698
- url2.path = base.path;
36697
+ if (url.path === "/") {
36698
+ url.path = base.path;
36699
36699
  } else {
36700
- url2.path = stripPathFilename(base.path) + url2.path;
36700
+ url.path = stripPathFilename(base.path) + url.path;
36701
36701
  }
36702
36702
  }
36703
- function normalizePath(url2, type) {
36703
+ function normalizePath(url, type) {
36704
36704
  const rel = type <= 4;
36705
- const pieces = url2.path.split("/");
36705
+ const pieces = url.path.split("/");
36706
36706
  let pointer = 1;
36707
36707
  let positive = 0;
36708
36708
  let addTrailingSlash = false;
@@ -36735,42 +36735,42 @@ var require_resolve_uri_umd = __commonJS({
36735
36735
  if (!path || addTrailingSlash && !path.endsWith("/..")) {
36736
36736
  path += "/";
36737
36737
  }
36738
- url2.path = path;
36738
+ url.path = path;
36739
36739
  }
36740
36740
  function resolve2(input, base) {
36741
36741
  if (!input && !base)
36742
36742
  return "";
36743
- const url2 = parseUrl(input);
36744
- let inputType = url2.type;
36743
+ const url = parseUrl(input);
36744
+ let inputType = url.type;
36745
36745
  if (base && inputType !== 7) {
36746
36746
  const baseUrl = parseUrl(base);
36747
36747
  const baseType = baseUrl.type;
36748
36748
  switch (inputType) {
36749
36749
  case 1:
36750
- url2.hash = baseUrl.hash;
36750
+ url.hash = baseUrl.hash;
36751
36751
  case 2:
36752
- url2.query = baseUrl.query;
36752
+ url.query = baseUrl.query;
36753
36753
  case 3:
36754
36754
  case 4:
36755
- mergePaths(url2, baseUrl);
36755
+ mergePaths(url, baseUrl);
36756
36756
  case 5:
36757
- url2.user = baseUrl.user;
36758
- url2.host = baseUrl.host;
36759
- url2.port = baseUrl.port;
36757
+ url.user = baseUrl.user;
36758
+ url.host = baseUrl.host;
36759
+ url.port = baseUrl.port;
36760
36760
  case 6:
36761
- url2.scheme = baseUrl.scheme;
36761
+ url.scheme = baseUrl.scheme;
36762
36762
  }
36763
36763
  if (baseType > inputType)
36764
36764
  inputType = baseType;
36765
36765
  }
36766
- normalizePath(url2, inputType);
36767
- const queryHash = url2.query + url2.hash;
36766
+ normalizePath(url, inputType);
36767
+ const queryHash = url.query + url.hash;
36768
36768
  switch (inputType) {
36769
36769
  case 2:
36770
36770
  case 3:
36771
36771
  return queryHash;
36772
36772
  case 4: {
36773
- const path = url2.path.slice(1);
36773
+ const path = url.path.slice(1);
36774
36774
  if (!path)
36775
36775
  return queryHash || ".";
36776
36776
  if (isRelative(base || input) && !isRelative(path)) {
@@ -36779,9 +36779,9 @@ var require_resolve_uri_umd = __commonJS({
36779
36779
  return path + queryHash;
36780
36780
  }
36781
36781
  case 5:
36782
- return url2.path + queryHash;
36782
+ return url.path + queryHash;
36783
36783
  default:
36784
- return url2.scheme + "//" + url2.user + url2.host + url2.port + url2.path + queryHash;
36784
+ return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
36785
36785
  }
36786
36786
  }
36787
36787
  return resolve2;
@@ -60526,8 +60526,8 @@ var require_missing_plugin_helper = __commonJS({
60526
60526
  }
60527
60527
  var getNameURLCombination = ({
60528
60528
  name,
60529
- url: url2
60530
- }) => `${name} (${url2})`;
60529
+ url
60530
+ }) => `${name} (${url})`;
60531
60531
  function generateMissingPluginMessage(missingPluginName, loc, codeFrame, filename) {
60532
60532
  let helpMessage = `Support for the experimental syntax '${missingPluginName}' isn't currently enabled (${loc.line}:${loc.column + 1}):
60533
60533
 
@@ -81472,12 +81472,12 @@ var require_module_types = __commonJS({
81472
81472
  }
81473
81473
  var loadMjsDefault = (0, _rewriteStackTrace.endHiddenCallStack)(function() {
81474
81474
  var _loadMjsDefault = _asyncToGenerator(function* (filepath) {
81475
- const url2 = (0, _url().pathToFileURL)(filepath).toString();
81475
+ const url = (0, _url().pathToFileURL)(filepath).toString();
81476
81476
  {
81477
81477
  if (!import_) {
81478
81478
  throw new _configError.default("Internal error: Native ECMAScript modules aren't supported by this platform.\n", filepath);
81479
81479
  }
81480
- return (yield import_(url2)).default;
81480
+ return (yield import_(url)).default;
81481
81481
  }
81482
81482
  });
81483
81483
  function loadMjsDefault2(_x) {
@@ -82201,8 +82201,8 @@ var require_import_meta_resolve = __commonJS({
82201
82201
  imports: void 0
82202
82202
  };
82203
82203
  }
82204
- function getPackageType(url2) {
82205
- const packageConfig = getPackageScopeConfig(url2);
82204
+ function getPackageType(url) {
82205
+ const packageConfig = getPackageScopeConfig(url);
82206
82206
  return packageConfig.type;
82207
82207
  }
82208
82208
  var {
@@ -82239,8 +82239,8 @@ var require_import_meta_resolve = __commonJS({
82239
82239
  } = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(parsed.pathname) || [null, null, null];
82240
82240
  return mimeToFormat(mime);
82241
82241
  }
82242
- function extname4(url2) {
82243
- const pathname = url2.pathname;
82242
+ function extname4(url) {
82243
+ const pathname = url.pathname;
82244
82244
  let index = pathname.length;
82245
82245
  while (index--) {
82246
82246
  const code = pathname.codePointAt(index);
@@ -82253,17 +82253,17 @@ var require_import_meta_resolve = __commonJS({
82253
82253
  }
82254
82254
  return "";
82255
82255
  }
82256
- function getFileProtocolModuleFormat(url2, _context, ignoreErrors) {
82257
- const ext = extname4(url2);
82256
+ function getFileProtocolModuleFormat(url, _context, ignoreErrors) {
82257
+ const ext = extname4(url);
82258
82258
  if (ext === ".js") {
82259
- const packageType = getPackageType(url2);
82259
+ const packageType = getPackageType(url);
82260
82260
  if (packageType !== "none") {
82261
82261
  return packageType;
82262
82262
  }
82263
82263
  return "commonjs";
82264
82264
  }
82265
82265
  if (ext === "") {
82266
- const packageType = getPackageType(url2);
82266
+ const packageType = getPackageType(url);
82267
82267
  if (packageType === "none" || packageType === "commonjs") {
82268
82268
  return "commonjs";
82269
82269
  }
@@ -82275,17 +82275,17 @@ var require_import_meta_resolve = __commonJS({
82275
82275
  if (ignoreErrors) {
82276
82276
  return void 0;
82277
82277
  }
82278
- const filepath = (0, _url().fileURLToPath)(url2);
82278
+ const filepath = (0, _url().fileURLToPath)(url);
82279
82279
  throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);
82280
82280
  }
82281
82281
  function getHttpProtocolModuleFormat() {
82282
82282
  }
82283
- function defaultGetFormatWithoutErrors(url2, context) {
82284
- const protocol = url2.protocol;
82283
+ function defaultGetFormatWithoutErrors(url, context) {
82284
+ const protocol = url.protocol;
82285
82285
  if (!hasOwnProperty2.call(protocolHandlers, protocol)) {
82286
82286
  return null;
82287
82287
  }
82288
- return protocolHandlers[protocol](url2, context, true) || null;
82288
+ return protocolHandlers[protocol](url, context, true) || null;
82289
82289
  }
82290
82290
  var {
82291
82291
  ERR_INVALID_ARG_VALUE
@@ -82334,16 +82334,16 @@ var require_import_meta_resolve = __commonJS({
82334
82334
  const double = doubleSlashRegEx.exec(isTarget ? target : request) !== null;
82335
82335
  _process().emitWarning(`Use of deprecated ${double ? "double slash" : "leading or trailing slash matching"} resolving "${target}" for module request "${request}" ${request === match ? "" : `matched to "${match}" `}in the "${internal ? "imports" : "exports"}" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${(0, _url().fileURLToPath)(base)}` : ""}.`, "DeprecationWarning", "DEP0166");
82336
82336
  }
82337
- function emitLegacyIndexDeprecation(url2, packageJsonUrl, base, main) {
82337
+ function emitLegacyIndexDeprecation(url, packageJsonUrl, base, main) {
82338
82338
  if (_process().noDeprecation) {
82339
82339
  return;
82340
82340
  }
82341
- const format = defaultGetFormatWithoutErrors(url2, {
82341
+ const format = defaultGetFormatWithoutErrors(url, {
82342
82342
  parentURL: base.href
82343
82343
  });
82344
82344
  if (format !== "module")
82345
82345
  return;
82346
- const urlPath = (0, _url().fileURLToPath)(url2.href);
82346
+ const urlPath = (0, _url().fileURLToPath)(url.href);
82347
82347
  const pkgPath = (0, _url().fileURLToPath)(new (_url()).URL(".", packageJsonUrl));
82348
82348
  const basePath = (0, _url().fileURLToPath)(base);
82349
82349
  if (!main) {
@@ -82361,8 +82361,8 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
82361
82361
  return new (_fs()).Stats();
82362
82362
  }
82363
82363
  }
82364
- function fileExists(url2) {
82365
- const stats = (0, _fs().statSync)(url2, {
82364
+ function fileExists(url) {
82365
+ const stats = (0, _fs().statSync)(url, {
82366
82366
  throwIfNoEntry: false
82367
82367
  });
82368
82368
  const isFile = stats ? stats.isFile() : void 0;
@@ -82882,10 +82882,10 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
82882
82882
  url: specifier
82883
82883
  };
82884
82884
  const conditions = getConditionsSet(context.conditions);
82885
- const url2 = moduleResolve(specifier, new (_url()).URL(parentURL), conditions, false);
82885
+ const url = moduleResolve(specifier, new (_url()).URL(parentURL), conditions, false);
82886
82886
  return {
82887
- url: url2.href,
82888
- format: defaultGetFormatWithoutErrors(url2, {
82887
+ url: url.href,
82888
+ format: defaultGetFormatWithoutErrors(url, {
82889
82889
  parentURL
82890
82890
  })
82891
82891
  };
@@ -85202,7 +85202,6 @@ var prepareCache = ({ repoRootPath, workPath }) => {
85202
85202
  };
85203
85203
 
85204
85204
  // src/start-dev-server.ts
85205
- var import_url2 = __toESM(require("url"));
85206
85205
  var import_module3 = require("module");
85207
85206
  var import_fs2 = require("fs");
85208
85207
  var import_path6 = require("path");
@@ -85477,8 +85476,8 @@ var startDevServer = async (opts) => {
85477
85476
  const runtime = bunVersion ? "bun" : "node";
85478
85477
  if (config.middleware === true && typeof meta.requestUrl === "string") {
85479
85478
  const matchers = new RegExp(getRegExpFromMatchers(staticConfig?.matcher));
85480
- const parsed = import_url2.default.parse(meta.requestUrl, true);
85481
- if (typeof parsed.pathname !== "string" || !matchers.test(parsed.pathname)) {
85479
+ const parsed = new URL(meta.requestUrl, "http://localhost");
85480
+ if (!matchers.test(parsed.pathname)) {
85482
85481
  return null;
85483
85482
  }
85484
85483
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "5.7.12",
3
+ "version": "5.7.15",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -32,9 +32,9 @@
32
32
  "tsx": "4.21.0",
33
33
  "typescript": "npm:typescript@5.9.3",
34
34
  "undici": "5.28.4",
35
- "@vercel/static-config": "3.2.0",
36
- "@vercel/error-utils": "2.0.3",
37
- "@vercel/build-utils": "13.19.1"
35
+ "@vercel/error-utils": "2.1.0",
36
+ "@vercel/build-utils": "13.21.0",
37
+ "@vercel/static-config": "3.3.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@babel/core": "7.24.4",
@@ -59,7 +59,7 @@
59
59
  "tree-kill": "1.2.2",
60
60
  "vite": "^5.1.6",
61
61
  "vitest": "^2.0.1",
62
- "@vercel/functions": "3.4.3"
62
+ "@vercel/functions": "3.5.0"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "node build.mjs",