Function: detail()
M can't be inferred (no parameter uses it), so it defaults to never, not object. Object would silently accept any meta shape.
detail<
Mextendsobject=never>(status:number):Carries<M>
Defined in: brand.ts:59
M can't be inferred (no parameter uses it), so it defaults to never, not object. Object would silently accept any meta shape.
Type Parameters
M
M extends object = never
The meta shape the code carries.
Parameters
status
number
Returns
Carries<M>
Example
const REGISTRY = {
WIDGET_NOT_FOUND: detail<{ widgetId: string }>(404), // meta required at the call site
BAD_INPUT: detail(400), // no <M> given, behaves like a bare code, not an unchecked one
} as const satisfies Record<string, number>