date-vir
Version:
Easy and explicit dates and times.
22 lines (21 loc) • 976 B
TypeScript
import { type Timezone } from './timezones.js';
/**
* Asserts that the given input is a valid timezone name.
*
* Note that this may actually allow names beyond what is currently in the exact {@link Timezone}
* type, because this function checks to see if the given timezone can be used to construct a date,
* regardless of whether it's in our typed list or not.
*
* @category Assertion
*/
export declare function assertValidTimezone(potentialTimezone: string, userMessage?: string | undefined): asserts potentialTimezone is Timezone;
/**
* Checks that the given timezone is valid.
*
* Note that this may actually allow names beyond what is currently in the exact {@link Timezone}
* type, because this function checks to see if the given timezone can be used to construct a date,
* regardless of whether it's in our typed list or not.
*
* @category Assertion
*/
export declare function isValidTimezone(potentialTimezone: string): potentialTimezone is Timezone;