"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.pipe = pipe;
/**
 * Chains functions together, passing the result of each function as input to the next.
 * The first argument is the initial value, followed by any number of transformation functions.
 *
 * @example
 * ```typescript
 * const addOne = (x: number) => x + 1;
 * const double = (x: number) => x * 2;
 * const stringify = (x: number) => `Result: ${x}`;
 *
 * const result = pipe(
 *   10,
 *   addOne,    // 11
 *   double,    // 22
 *   stringify  // "Result: 22"
 * );
 * ```
 */

function pipe(initialValue, ...transformers) {
  return transformers.reduce((currentValue, transformer) => transformer(currentValue), initialValue);
}
//# sourceMappingURL=pipe.js.map