stellar_prune/build/dev/javascript/gleam_stdlib/gleam/function.mjs
2025-11-30 15:44:22 +01:00

17 lines
405 B
JavaScript

/**
* Takes a single argument and always returns its input value.
*/
export function identity(x) {
return x;
}
/**
* Takes an argument and a single function, calls that function with that
* argument and returns that argument instead of the function return value.
*
* Useful for running synchronous side effects in a pipeline.
*/
export function tap(arg, effect) {
effect(arg);
return arg;
}