UNPKG

891 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var negate = require("lodash/negate");
4var factory_1 = require("./factory");
5var applicators_1 = require("./applicators");
6/**
7 * Negates a functions result or, when used on a property, creates a function that
8 * negates the result of a provided function.
9 * @param {ResolvableFunction} [fn] A resolvable function.
10 * @example
11 * class MyClass {
12 * @Negate('fn')
13 * fn2: () => boolean;
14 *
15 * fn(): boolean {
16 * return true;
17 * }
18 * }
19 *
20 * const myClass = new MyClass();
21 *
22 * myClass.fn2(); //=> false
23 */
24exports.Negate = factory_1.DecoratorFactory.createInstanceDecorator(new factory_1.DecoratorConfig(negate, new applicators_1.PartialValueApplicator(), { property: true, optionalParams: true }));
25exports.negate = exports.Negate;
26exports.default = exports.Negate;
27//# sourceMappingURL=negate.js.map
\No newline at end of file