# isValidFiscalPattern

Industry: Core

## Signature

```ts
isValidFiscalPattern(pattern: unknown): pattern is FiscalPattern
```

Return true when `pattern` is a valid FiscalPattern.

- Valid patterns are: "4-5-4", "4-4-5", "5-4-4". One published 4-5-4 example is the NRF retail calendar (US).
- Accepts any input type and returns false for non-string values.
- Uses type assertion to narrow the type.
- A pattern read from config, an env var or a form is a bare string until something narrows it. Narrow it here; to check a whole calendar before `getFiscalPeriod`, whose null also means an invalid date, use `isValidFiscalCalendar`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `pattern` | `unknown` | candidate value of any type |

## Returns

boolean indicating validity

## Related types

- [`FiscalPattern`](/gmt/reference/types/FiscalPattern/)

## Examples

```ts
import { isValidFiscalPattern } from "@northguild/gmt/calendar/validate";

isValidFiscalPattern("4-5-4") // true
```

## Source

[calendar/validate/isValidFiscalPattern.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/calendar/validate/isValidFiscalPattern.ts)
