UNPKG

1.75 kBSource Map (JSON)View Raw
1{"version":3,"file":"curryRight.js","sourceRoot":"","sources":["src/curryRight.ts"],"names":[],"mappings":";;AAAA,8CAAiD;AAEjD,qCAAuF;AACvF,6CAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACU,QAAA,UAAU,GAAG,0BAAgB,CAAC,uBAAuB,CAChE,IAAI,yBAAe,CAAC,UAAU,EAAE,IAAI,gCAAkB,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAC9D,CAAC;AACd,qBAHV,kBAAU,CAGU;AACjC,kBAAe,kBAAU,CAAC","sourcesContent":["import curryRight = require('lodash/curryRight');\n\nimport { DecoratorConfig, DecoratorFactory, BiTypedMethodDecorator1 } from './factory';\nimport { PreValueApplicator } from './applicators';\n\n/**\n * This method is like _.curry except that arguments are applied to func in the manner of _.partialRight instead of _.partial.\n * The arity of func may be specified if func.length is not sufficient.\n * The original function is bound to the instance. If the method is needed to call in a different context use `CurryAll`.\n *\n * The _.curryRight.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for provided arguments.\n *\n * Note: This method doesn't set the \"length\" property of curried functions.\n * @param {number} [arity] The arity of func.\n * @example\n *\n * class MyClass {\n * multiplier = 2;\n *\n * @CurryRight()\n * add(a, b) {\n * return (a + b) * this.multiplier;\n * }\n * }\n *\n * const myClass = new MyClass();\n *\n * const add5 = myClass.add(5);\n *\n * add5AndMultiply(10); // => 30\n */\nexport const CurryRight = DecoratorFactory.createInstanceDecorator(\n new DecoratorConfig(curryRight, new PreValueApplicator(), { bound: true, optionalParams: true })\n) as BiTypedMethodDecorator1<number>;\nexport { CurryRight as curryRight };\nexport default CurryRight;\n"]}
\No newline at end of file