UNPKG

@toreda/time

Version:

Simple, small footprint library for common time operations and converting between units of time.

15 lines (14 loc) 501 B
import type { TimeUnit } from './unit'; export declare class TimeUtils { static withinSafeRange(n: number): boolean; /** * Check whether timeConvert can convert between the provided units. * @param from * @param to * @param value * @returns */ static canConvert(from: TimeUnit, to: TimeUnit, value?: number | null): value is number; static resolveDecimals(decimals?: number): number; static roundToDecimals(value: number, decimals: number): number; }