UNPKG

@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.

21 lines • 969 B
import { FiscalYearLabel } from "../../types/fiscal-calendar.js"; import "../../types/index.js"; /** * Return true when `value` is a valid FiscalYearLabel: the rule that picks the calendar year * naming a fiscal year. * * - Valid values are `"startYear"`, `"endYear"` and `"majorityYear"`. * - Accepts any input type and returns false for non-string values. * - Use it to narrow a value read from config, an env var or a form before building a * `FiscalCalendar` or passing `getQuarter` its options. * * @param value candidate value of any type * @returns boolean indicating validity * * @example isValidFiscalYearLabel("startYear") // true * @example isValidFiscalYearLabel("endYear") // true * @example isValidFiscalYearLabel("majorityYear") // true * @example isValidFiscalYearLabel("fiscalYear") // false * @example isValidFiscalYearLabel(null) // false */ export declare function isValidFiscalYearLabel(value: unknown): value is FiscalYearLabel;