/** * Copyright (c) 2017-present A. Matías Quezada */ /** * Decorates a function to not be executed until all required parameters are passed. Even on different calls. * It uses functions `.length` property to detect the required arguments count if length is not passed. * * @link https://gist.github.com/amatiasq/2e4344792f28611fa499 * * @param {Function} fn Function to curry. * @param {Number} length The arguments required to invoke the function. Optional. By default is fn.length * @returns {Function} The currified function. */ export default function curry(fn: (...args: TArgs[]) => TOut, length?: number): (...args: TArgs[]) => TOut | Currified; export declare type Currified = (...args: TArgs[]) => Currified | TOut;