@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.
12 lines • 590 B
TypeScript
/**
* Resolve a `weekStartsOn` option value.
*
* - `undefined` (the option omitted) resolves to `"monday"`, the ISO 8601 week start.
* - `"monday"` and `"sunday"` resolve to themselves.
* - Any other value is invalid and resolves to `null`, which callers map to their sentinel — as
* Temporal's GetOption rejects a string outside the allowed list.
*
* @param weekStartsOn raw option value from caller input
* @returns `"monday"`, `"sunday"`, or `null` when the value is invalid
*/
export declare function resolveWeekStartsOn(weekStartsOn: unknown): "monday" | "sunday" | null;