# isValidNanoPattern

Industry: Core

## Signature

```ts
isValidNanoPattern(value: string): boolean
isValidNanoPattern(value: void | {} | null | undefined): boolean
isValidNanoPattern(value: unknown): value is string
```

Validate whether a string is a nanosecond timestamp `parseNanoseconds` will parse.

- `parseNanoseconds` returns `0n` for both `"0"` and garbage, so this is how the two are told apart — the check its own JSDoc asks callers to make.
- Shape **and** range: a canonical decimal integer (optional `-`, digits, no leading zeros) that also falls inside what `Temporal.Instant` can represent. Shape alone is `nanosecondDecimal` in `regex/`.
- Length is checked before `BigInt`, so an arbitrarily long payload string is rejected rather than converted.
- Takes the string *value*, not JSON text — `JSON.parse(payload).observedAt`, not the payload. A quoted `"\"123\""` is not a decimal integer.
- A value that is not a string, a `String` object included, returns `false`. A `true` result narrows an `unknown` value to `string`.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | any value; a string is checked as the decimal string form of a nanosecond timestamp |

## Returns

boolean indicating whether `parseNanoseconds` will parse it

## Examples

```ts
import { isValidNanoPattern } from "@northguild/gmt/precision/validate";

isValidNanoPattern("1710072000123456789") // true
```

## Source

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