Identity helper for declaring a primitive. Returns its argument
unchanged.
The helper exists so TypeScript can infer TArgs from the
annotation on build's parameter. Without it, the args shape must
either be repeated as a variable type annotation, or TArgs falls
back to its unknown default, discarding the args type at every
downstream call site.
Does not validate the id namespace, that check happens at runtime
inside register.
Returns
The same primitive, unchanged.
Example
The args shape lives only on build's parameter. TypeScript infers
TArgs = OlderThanArgs and olderThan ends up typed as
RulePrimitive<OlderThanArgs>, no extra annotation needed.
Identity helper for declaring a primitive. Returns its argument unchanged.
The helper exists so TypeScript can infer
TArgsfrom the annotation onbuild's parameter. Without it, the args shape must either be repeated as a variable type annotation, orTArgsfalls back to itsunknowndefault, discarding the args type at every downstream call site.Does not validate the
idnamespace, that check happens at runtime inside register.Returns
The same
primitive, unchanged.Example
The args shape lives only on
build's parameter. TypeScript infersTArgs = OlderThanArgsandolderThanends up typed asRulePrimitive<OlderThanArgs>, no extra annotation needed.