{
  "version": 3,
  "sources": ["../Source/index.ts", "../Source/Curry.Internal.ts", "../Source/Curry.ts"],
  "sourcesContent": ["/**\r\n * @file      index.ts\r\n * @author    Gage Sorrell <gage@sorrell.sh>\r\n * @copyright (c) 2026 Gage Sorrell\r\n * @license   MIT\r\n */\r\n\r\nexport * from \"./Curry.js\";\r\nexport * from \"./Curry.Types.js\";\r\nexport * from \"./Functional.Types.js\";", "/**\r\n * @file      Curry.Internal.ts\r\n * @author    Gage Sorrell <gage@sorrell.sh>\r\n * @copyright (c) 2026 Gage Sorrell\r\n * @license   MIT\r\n */\r\n\r\nexport const CurriedArgument: unique symbol = Symbol(\"__CurriedArgument__\");\r\n", "/**\n * @file      Curry.ts\n * @author    Gage Sorrell <gage@sorrell.sh>\n * @copyright (c) 2026 Gage Sorrell\n * @license   MIT\n */\n\nimport type {\n    FCurriedArgument,\n    TArgumentVectorWithCurry,\n    TCurriedArgumentVector,\n    TCurriedFunction\n} from \"./Curry.Types.js\";\nimport { CurriedArgument } from \"./Curry.Internal.js\";\n\nexport/**\n       * Denotes in the `CurriedArgumentVector` of a call to {@link Curry} an argument in the argument vector\n       * of the `Function` given to {@link Curry} that should remain in the argument vector of the returned\n       * curried function.\n       */\nconst _: FCurriedArgument = CurriedArgument;\n\n/* eslint-disable @stylistic/max-len */\n\n/**\n * Curry a function by fixing some (but not all) of its arguments, by providing a given {@link InFunction},\n * and a {@link CurriedArgumentVector} containing the fixed arguments, and {@link _} in place of the\n * arguments that will remain open.\n *\n * @template ArgumentVectorType - The base type of the argument vector of the given {@link InFunction}.\n * @template ThisReturnType - The base type of the return type of the given {@link InFunction}.\n *\n * @param InFunction - The function to curry.\n * @param CurriedArgumentVector - A vector matching the argument vector of {@link InFunction}, with {@link _}\n * appearing at least once in place of an argument of proper type to {@link InFunction}.\n *\n * @returns {TCurriedFunction<Parameters<typeof InFunction>, typeof CurriedArgumentVector, ReturnType<typeof InFunction>>} A\n * function identical to the given {@link InFunction}, but with argument vector consisting of the arguments replaced by {@link _}\n * in the given {@link CurriedArgumentVector}.\n *\n * @example\n * ```typescript\n * import { Curry, _ } from \"@sorrell/functional\";\n *\n * function LongFunction(A: string, B: boolean, C: number): string\n * {\n *     return `${ A }, ${ B }, ${ C }`;\n * }\n *\n * const ShortFunction = Curry(LongFunction, \"Fixed\", _, 30);\n * const Result = ShortFunction(true);\n * // `Result` <- `\"Fixed, true, 30\"`\n * ```\n */\nexport function Curry<\n    ArgumentVectorType extends Array<unknown>,\n    ThisReturnType\n>(\n    InFunction: (...ArgumentVector: ArgumentVectorType) => ThisReturnType,\n    ...CurriedArgumentVector: TArgumentVectorWithCurry<Parameters<typeof InFunction>>\n): TCurriedFunction<Parameters<typeof InFunction>, typeof CurriedArgumentVector, ReturnType<typeof InFunction>>\n{\n    /* eslint-enable @stylistic/max-len */\n    type FThisArgumentVector = TCurriedArgumentVector<\n        Parameters<typeof InFunction>,\n        typeof CurriedArgumentVector\n    >;\n\n    /* eslint-disable-next-line jsdoc/require-jsdoc */\n    function ConstructFilledArgumentVector(\n        ...ArgumentVector: FThisArgumentVector\n    ): Parameters<typeof InFunction>\n    {\n        let VariableAssignedIndex: number = 0;\n        return CurriedArgumentVector.map((Argument: unknown) =>\n        {\n            if (Argument === _)\n            {\n                const Out: unknown = ArgumentVector[VariableAssignedIndex];\n                VariableAssignedIndex++;\n                return Out;\n            }\n            else\n            {\n                return Argument;\n            }\n        }) as unknown as Parameters<typeof InFunction>;\n    }\n\n    type FThisReturnType =\n        TCurriedFunction<\n            Parameters<typeof InFunction>,\n            typeof CurriedArgumentVector,\n            ReturnType<typeof InFunction>\n        >;\n\n    return function(...ArgumentVector: FThisArgumentVector): ReturnType<typeof InFunction>\n    {\n        return InFunction(\n            /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n            ...ConstructFilledArgumentVector(...ArgumentVector) as any\n        ) as ReturnType<typeof InFunction>;\n    } as FThisReturnType;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACOO,IAAM,kBAAiC,uBAAO,qBAAqB;;;ACa1E,IAAM,IAAsB;AAkCrB,SAAS,MAIZ,eACG,uBAEP;AAQI,WAAS,iCACF,gBAEP;AACI,QAAI,wBAAgC;AACpC,WAAO,sBAAsB,IAAI,CAAC,aAClC;AACI,UAAI,aAAa,GACjB;AACI,cAAM,MAAe,eAAe,qBAAqB;AACzD;AACA,eAAO;AAAA,MACX,OAEA;AACI,eAAO;AAAA,MACX;AAAA,IACJ,CAAC;AAAA,EACL;AASA,SAAO,YAAY,gBACnB;AACI,WAAO;AAAA,MAEH,GAAG,8BAA8B,GAAG,cAAc;AAAA,IACtD;AAAA,EACJ;AACJ;",
  "names": []
}
