/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

'use strict';

/**
 * Applies a series of functions to an input value, passing the result of each function
 * as the input to the next function.
 *
 * @param {*} value - The initial value to be processed by the functions.
 * @returns {*} The final result after all functions have been applied.
 */
module.exports = function pipe( ...fns ) {
	return value => fns.reduce( ( acc, fn ) => fn( acc ), value );
};
