Import
import type { Maybe, SafeAny } from 'ngwr/utils';Usage
function findUser(id: string): Maybe<User> {
return db.get(id) ?? null;
}
// Interop boundary where the shape genuinely isn't known —
// unlike `any`, the intent is explicit and greppable.
function fromLegacyBridge(payload: SafeAny): void {
// narrow before use
}API
| Name | Description | Type | Default |
|---|---|---|---|
Maybe<T> | A value that may be absent — T | null | undefined. Pairs with isDefined to narrow back to T. | type alias | — |
SafeAny | Explicitly untyped value for interop boundaries. Same mechanics as any, but the name is searchable and signals intent. | type alias | — |