frontend/.pnpm-store/v3/files/a9/b98d27853559aefb7289c4975e2055f2a08f0b79c37d5f938b118cc4027db64a1e011e4b4bfcaa018caf2e2f359936a452a72f7ad15b1c05d811d020864b17

21 lines
641 B
Plaintext

"use strict";
var isValue = require("../../object/is-value")
, callable = require("../../object/valid-callable")
, aFrom = require("../../array/from");
var apply = Function.prototype.apply
, call = Function.prototype.call
, callFn = function (arg, fn) { return call.call(fn, this, arg); };
module.exports = function (fnIgnored /*, …fnn*/) {
var fns, first;
var args = aFrom(arguments);
fns = isValue(this) ? [this].concat(args) : args;
fns.forEach(callable);
fns = fns.reverse();
first = fns[0];
fns = fns.slice(1);
return function (argIgnored) { return fns.reduce(callFn, apply.call(first, this, arguments)); };
};