reports/frontend/node_modules/es-toolkit/dist/fp/math/add.mjs
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

21 lines
541 B
JavaScript

//#region src/fp/math/add.ts
/**
* Creates a function that adds `addend` to its input. Use it with {@link pipe},
* or as the callback of a function such as {@link map}.
*
* @param addend - The number to add to the input.
* @returns A function that maps a `number` to `value + addend`.
*
* @example
* import { pipe, map, add } from 'es-toolkit/fp';
*
* pipe(3, add(2)); // => 5
* pipe([1, 2, 3], map(add(10))); // => [11, 12, 13]
*/
function add(addend) {
return function(value) {
return value + addend;
};
}
//#endregion
export { add };