1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var curry = require("lodash/curry");
|
4 | var factory_1 = require("./factory");
|
5 | var applicators_1 = require("./applicators");
|
6 | /**
|
7 | * Creates a function that accepts arguments of func and either invokes func returning its result, if at least arity number of arguments have been provided, or returns a function that accepts the remaining func arguments, and so on.
|
8 | * The arity of func may be specified if func.length is not sufficient.
|
9 | *
|
10 | * The _.curry.placeholder value, which defaults to _ in monolithic builds, may be used as a placeholder for provided arguments.
|
11 | *
|
12 | * Note: This method doesn't set the "length" property of curried functions.
|
13 | * Note: The original function invoked will not be called in the context of the instance. Use `Curry` to for using it bound.
|
14 | * @param {number} [arity] The arity of func.
|
15 | * @example
|
16 | *
|
17 | * class MyClass {
|
18 | * @CurryAll()
|
19 | * add(a, b) {
|
20 | * return (a + b);
|
21 | * }
|
22 | * }
|
23 | *
|
24 | * const myClass = new MyClass();
|
25 | *
|
26 | * const add5 = myClass.add(5);
|
27 | *
|
28 | * add5AndMultiply(10); // => 15
|
29 | */
|
30 | exports.CurryAll = factory_1.DecoratorFactory.createDecorator(new factory_1.DecoratorConfig(curry, new applicators_1.PreValueApplicator(), { optionalParams: true }));
|
31 | exports.curryAll = exports.CurryAll;
|
32 | exports.default = exports.CurryAll;
|
33 | //# sourceMappingURL=curryAll.js.map |
\ | No newline at end of file |