
- add new fields to support this - when free: - fade out all event types after first - hide events after first on booking page - make booking page after the first one 404 if accessed directly - add e2e tests
11 lines
283 B
TypeScript
11 lines
283 B
TypeScript
export function asStringOrNull(str: unknown) {
|
|
return typeof str === "string" ? str : null;
|
|
}
|
|
|
|
export function asStringOrThrow(str: unknown): string {
|
|
const type = typeof str;
|
|
if (type !== "string") {
|
|
throw new Error(`Expected "string" - got ${type}`);
|
|
}
|
|
return str;
|
|
}
|