MCPcopy
hub / github.com/remeda/remeda / identity

Function identity

packages/remeda/src/identity.ts:20–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 * @category Function
19 */
20export function identity(): IdentityFunction {
21 // Notice that the exported identity function is just the "factory" for the
22 // identity function. We do it this way so that all "Function" utilities have
23 // a similar API where the function is called, and not just used "headless".
24 // e.g. `identity()` and not `identity`, just like the API for `constant(1)`.
25 return identityImplementation;
26}
27
28const identityImplementation: IdentityFunction = (firstParameter) =>
29 firstParameter;

Callers 15

times.test-d.tsFile · 0.90
times.test.tsFile · 0.90
identity.test.tsFile · 0.90
map.test.tsFile · 0.90
nthBy.test-d.tsFile · 0.90
difference.test.tsFile · 0.90
find.test.tsFile · 0.90
mapKeys.test-d.tsFile · 0.90
nthBy.test.tsFile · 0.90
debounce.test-d.tsFile · 0.90
filter.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…