MCPcopy
hub / github.com/remeda/remeda / constant

Function constant

packages/remeda/src/constant.ts:28–33  ·  view source on GitHub ↗
(
  value: T,
)

Source from the content-addressed store, hash-verified

26 * @category Function
27 */
28export function constant<const T>(
29 value: T,
30): // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters -- There is no other way to make typescript infer the function arguments "backwards" in data-last invocations without the Args type parameter. @see: https://github.com/typescript-eslint/typescript-eslint/issues/9887
31<Args extends readonly unknown[]>(...args: Args) => T {
32 return () => value;
33}

Callers 15

sumBy.test-d.tsFile · 0.90
mapKeys.test.tsFile · 0.90
times.test.tsFile · 0.90
map.test.tsFile · 0.90
constant.test-d.tsFile · 0.90
filter.test-d.tsFile · 0.90
mapKeys.test-d.tsFile · 0.90
funnel.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…