Skip to content

Commit 8a56621

Browse files
committed
fix: ProxyConfigArray in type def is not an Array
1 parent 75999bb commit 8a56621

File tree

2 files changed

+85
-62
lines changed

2 files changed

+85
-62
lines changed

lib/Server.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ const schema = require("./options.json");
121121
* @callback ByPass
122122
* @param {Request} req
123123
* @param {Response} res
124-
* @param {ProxyConfigArray} proxyConfig
124+
* @param {ProxyConfigArrayItem} proxyConfig
125125
*/
126126

127127
/**
128-
* @typedef {{ path?: string | string[] | undefined, context?: string | string[] | HttpProxyMiddlewareOptionsFilter | undefined } & HttpProxyMiddlewareOptions & ByPass} ProxyConfigArray
128+
* @typedef {{ path?: string | string[] | undefined, context?: string | string[] | HttpProxyMiddlewareOptionsFilter | undefined } & HttpProxyMiddlewareOptions & ByPass} ProxyConfigArrayItem
129+
*/
130+
131+
/**
132+
* @typedef {ProxyConfigArrayItem[]} ProxyConfigArray
129133
*/
130134

131135
/**
@@ -194,7 +198,7 @@ const schema = require("./options.json");
194198
* @property {boolean} [http2]
195199
* @property {"http" | "https" | "spdy" | string | ServerConfiguration} [server]
196200
* @property {boolean | "sockjs" | "ws" | string | WebSocketServerConfiguration} [webSocketServer]
197-
* @property {ProxyConfigMap | ProxyConfigArray | ProxyArray} [proxy]
201+
* @property {ProxyConfigMap | ProxyConfigArray | ProxyConfigArrayItem | ProxyArray} [proxy]
198202
* @property {boolean | string | Open | Array<string | Open>} [open]
199203
* @property {boolean} [setupExitSignals]
200204
* @property {boolean | ClientConfiguration} [client]
@@ -2130,7 +2134,7 @@ class Server {
21302134
const { createProxyMiddleware } = require("http-proxy-middleware");
21312135

21322136
/**
2133-
* @param {ProxyConfigArray} proxyConfig
2137+
* @param {ProxyConfigArrayItem} proxyConfig
21342138
* @returns {RequestHandler | undefined}
21352139
*/
21362140
const getProxyMiddleware = (proxyConfig) => {

0 commit comments

Comments
 (0)