mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
chore(): resolve conflicts
This commit is contained in:
@@ -31,7 +31,7 @@ export interface ControllerOptions extends ScopeOptions, VersionOptions {
|
||||
*
|
||||
* @see [Routing](https://docs.nestjs.com/controllers#routing)
|
||||
*/
|
||||
host?: string | string[];
|
||||
host?: string | RegExp | Array<string | RegExp>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,7 +101,7 @@ export class RouterExplorer {
|
||||
instanceWrapper: InstanceWrapper,
|
||||
moduleKey: string,
|
||||
applicationRef: T,
|
||||
host: string | string[],
|
||||
host: string | RegExp | Array<string | RegExp>,
|
||||
routePathMetadata: RoutePathMetadata,
|
||||
) {
|
||||
const { instance } = instanceWrapper;
|
||||
@@ -181,7 +181,7 @@ export class RouterExplorer {
|
||||
instanceWrapper: InstanceWrapper,
|
||||
moduleKey: string,
|
||||
routePathMetadata: RoutePathMetadata,
|
||||
host: string | string[],
|
||||
host: string | RegExp | Array<string | RegExp>,
|
||||
) {
|
||||
(routeDefinitions || []).forEach(routeDefinition => {
|
||||
const { version: methodVersion } = routeDefinition;
|
||||
@@ -204,7 +204,7 @@ export class RouterExplorer {
|
||||
instanceWrapper: InstanceWrapper,
|
||||
moduleKey: string,
|
||||
routePathMetadata: RoutePathMetadata,
|
||||
host: string | string[],
|
||||
host: string | RegExp | Array<string | RegExp>,
|
||||
) {
|
||||
const {
|
||||
path: paths,
|
||||
@@ -277,14 +277,17 @@ export class RouterExplorer {
|
||||
});
|
||||
}
|
||||
|
||||
private applyHostFilter(host: string | string[], handler: Function) {
|
||||
private applyHostFilter(
|
||||
host: string | RegExp | Array<string | RegExp>,
|
||||
handler: Function,
|
||||
) {
|
||||
if (!host) {
|
||||
return handler;
|
||||
}
|
||||
|
||||
const httpAdapterRef = this.container.getHttpAdapterRef();
|
||||
const hosts = Array.isArray(host) ? host : [host];
|
||||
const hostRegExps = hosts.map((host: string) => {
|
||||
const hostRegExps = hosts.map((host: string | RegExp) => {
|
||||
const keys = [];
|
||||
const regexp = pathToRegexp(host, keys);
|
||||
return { regexp, keys };
|
||||
|
||||
Reference in New Issue
Block a user