Returns the passed argument. This function is a macro that compiles to just arg.
arg
This is useful for ensuring that a value matches the given type in areas where it is not directly possible to do so.
type P = { x: number, y: number };const obj = { pos: identity<P>({ x: 5, y: 10 });} Copy
type P = { x: number, y: number };const obj = { pos: identity<P>({ x: 5, y: 10 });}
Returns the passed argument. This function is a macro that compiles to just
arg
.This is useful for ensuring that a value matches the given type in areas where it is not directly possible to do so.