re-nav/source/redirect/exports.ts

15 lines
353 B
TypeScript
Raw Normal View History

2022-10-05 17:08:17 +00:00
import {HostnameRedirect} from './hostname.js';
export * from './base.js';
export * from './hostname.js';
export type Redirects = HostnameRedirect;
2022-10-12 22:04:51 +00:00
export function parseRedirect<P extends Redirects['parameters']>(
2022-10-05 17:08:17 +00:00
parameters: P,
): Redirects | undefined {
2022-10-12 22:30:26 +00:00
if (parameters?.type === 'hostname') {
2022-10-05 17:08:17 +00:00
return new HostnameRedirect(parameters);
}
}