UNPKG

1.29 kBSource Map (JSON)View Raw
1{"version":3,"file":"negate.js","sourceRoot":"","sources":["src/negate.ts"],"names":[],"mappings":";;AAAA,sCAAyC;AAEzC,qCAKmB;AACnB,6CAAuD;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,MAAM,GAAG,0BAAgB,CAAC,uBAAuB,CAC5D,IAAI,yBAAe,CAAC,MAAM,EAAE,IAAI,oCAAsB,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAC3D,CAAC;AACxB,iBAHN,cAAM,CAGM;AACzB,kBAAe,cAAM,CAAC","sourcesContent":["import negate = require('lodash/negate');\n\nimport {\n DecoratorConfig,\n DecoratorFactory,\n ResolvableFunction,\n BiTypedDecorator1\n} from './factory';\nimport { PartialValueApplicator } from './applicators';\n\n/**\n * Negates a functions result or, when used on a property, creates a function that\n * negates the result of a provided function.\n * @param {ResolvableFunction} [fn] A resolvable function.\n * @example\n * class MyClass {\n * @Negate('fn')\n * fn2: () => boolean;\n *\n * fn(): boolean {\n * return true;\n * }\n * }\n *\n * const myClass = new MyClass();\n *\n * myClass.fn2(); //=> false\n */\nexport const Negate = DecoratorFactory.createInstanceDecorator(\n new DecoratorConfig(negate, new PartialValueApplicator(), { property: true, optionalParams: true })\n) as BiTypedDecorator1<ResolvableFunction>;\nexport { Negate as negate };\nexport default Negate;\n"]}
\No newline at end of file