Creates a function that returns one of its arguments.
The type of returned argument.
The self type of the returned function.
The index of the arguments to use.
A function that returns one of its arguments.
Rest
import { returnsArg } from "@std/testing/mock";import { assertEquals } from "@std/assert";const func = returnsArg(1);assertEquals(func(1, 2, 3), 2); Copy
import { returnsArg } from "@std/testing/mock";import { assertEquals } from "@std/assert";const func = returnsArg(1);assertEquals(func(1, 2, 3), 2);
Creates a function that returns one of its arguments.