@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
13 lines • 612 B
TypeScript
/**
* Normalize a duration unit string to its plural form.
*
* - Accepts singular ("day"), plural ("days"), and already-plural forms.
* - Returns the original string if it is not a recognized DateTimeDurationUnit.
* - Returns a non-string input unchanged, so callers can pass raw option values and let their own
* validator reject them.
*
* @param unit raw unit value from caller input
* @returns normalized plural unit string, or the original if not recognized
*/
export declare function resolveDurationUnit(unit: string): string;
export declare function resolveDurationUnit(unit: unknown): unknown;