HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-26-0-120 6.17.0-1009-aws #9~24.04.2-Ubuntu SMP Fri Mar 6 23:50:29 UTC 2026 x86_64
User: ubuntu (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //var/www/html/orbi-individual/node_modules/date-fns/fp/_lib/convertToFP.js
"use strict";
exports.convertToFP = convertToFP;

/**
 * Converts a function to a curried function that accepts arguments in reverse
 * order.
 *
 * @param fn - The function to convert to FP
 * @param arity - The arity of the function
 * @param curriedArgs - The curried arguments
 *
 * @returns FP version of the function
 *
 * @private
 */
function convertToFP(fn, arity, curriedArgs = []) {
  return curriedArgs.length >= arity
    ? fn(...curriedArgs.slice(0, arity).reverse())
    : (...args) => convertToFP(fn, arity, curriedArgs.concat(args));
}