Add SimpleRedirect to parseRedirect.
This commit is contained in:
parent
b54d6ab0c2
commit
1743959769
|
@ -10,7 +10,13 @@ export type Redirects = HostnameRedirect | SimpleRedirect;
|
||||||
export function parseRedirect<P extends Redirects['parameters']>(
|
export function parseRedirect<P extends Redirects['parameters']>(
|
||||||
parameters: P,
|
parameters: P,
|
||||||
): Redirects | undefined {
|
): Redirects | undefined {
|
||||||
if (parameters?.type === 'hostname') {
|
const type = parameters?.type;
|
||||||
|
|
||||||
|
if (type === 'hostname') {
|
||||||
return new HostnameRedirect(parameters);
|
return new HostnameRedirect(parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === 'simple') {
|
||||||
|
return new SimpleRedirect(parameters);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue