re-nav/source/redirect/exports.ts

15 lines
352 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 {
if (parameters.type === 'hostname') {
return new HostnameRedirect(parameters);
}
}