UNPKG

794 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var ary = require("lodash/ary");
4var factory_1 = require("./factory");
5var applicators_1 = require("./applicators");
6var decorator = factory_1.DecoratorFactory.createDecorator(new factory_1.DecoratorConfig(ary, new applicators_1.PreValueApplicator()));
7/**
8 * Creates a function that invokes func, with up to n arguments, ignoring any additional arguments.
9 * @param {number} n The arity cap.
10 * @example
11 *
12 * class MyClass {
13 * @Ary(1)
14 * fn(...args) {
15 * return args;
16 * }
17 * }
18 *
19 * const myClass = new MyClass();
20 *
21 * myClass.fn(1, 2, 3, 4); // => [ 1 ]
22 */
23function Ary(n) {
24 return decorator(n);
25}
26exports.Ary = Ary;
27exports.ary = Ary;
28exports.default = decorator;
29//# sourceMappingURL=ary.js.map
\No newline at end of file