DieselDepot-APP/node_modules/es-toolkit/dist/fp/math/multiply.js
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

21 lines
616 B
JavaScript

//#region src/fp/math/multiply.ts
/**
* Creates a function that multiplies its input by `multiplicand`. Use it with
* {@link pipe}, or as the callback of a function such as {@link map}.
*
* @param multiplicand - The number to multiply the input by.
* @returns A function that maps a `number` to `value * multiplicand`.
*
* @example
* import { pipe, map, multiply } from 'es-toolkit/fp';
*
* pipe(3, multiply(2)); // => 6
* pipe([1, 2, 3], map(multiply(3))); // => [3, 6, 9]
*/
function multiply(multiplicand) {
return function(value) {
return value * multiplicand;
};
}
//#endregion
exports.multiply = multiply;