@toreda/time
Version:
Simple, small footprint library for common time operations and converting between units of time.
12 lines (11 loc) • 432 B
TypeScript
import { type TimeUnit } from '../unit';
/**
* Returns the first value that is a valid `TimeUnit`. If none of the
* provided values are valid, returns `fallback`.
*
* @param fallback Returned when no `values` entry is a valid `TimeUnit`.
* @param values Candidate values to validate, in priority order.
*
* @category Time Units
*/
export declare function timeUnitValue(fallback: TimeUnit, ...values: unknown[]): TimeUnit;