UNPKG

1.59 kBSource Map (JSON)View Raw
1{"version":3,"file":"flowRight.js","sourceRoot":"","sources":["src/flowRight.ts"],"names":[],"mappings":";;AAAA,4CAA+C;AAE/C,qCAKmB;AACnB,6CAAkD;AAElD,IAAM,SAAS,GAAG,0BAAgB,CAAC,uBAAuB,CACxD,IAAI,yBAAe,CAAC,SAAS,EAAE,IAAI,+BAAiB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAC3F,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAA0B,aAA4B;SAA5B,UAA4B,EAA5B,qBAA4B,EAA5B,IAA4B;QAA5B,wBAA4B;;IACpD,MAAM,CAAC,SAAS,eAAI,GAAG,EAAE;AAC3B,CAAC;AAFD,8BAEC;AACqB,8BAAS;AAC/B,kBAAe,SAAS,CAAC","sourcesContent":["import flowRight = require('lodash/flowRight');\n\nimport {\n DecoratorConfig,\n DecoratorFactory,\n LodashDecorator,\n ResolvableFunction\n} from './factory';\nimport { ComposeApplicator } from './applicators';\n\nconst decorator = DecoratorFactory.createInstanceDecorator(\n new DecoratorConfig(flowRight, new ComposeApplicator({ post: false }), { property: true })\n);\n\n/**\n * Creates a function that returns the result of invoking the given functions with the this binding of the created function,\n * where each successive invocation is supplied the return value of the previous.\n *\n * @example\n *\n * class MyClass {\n * name = 'Ted';\n *\n * @FlowRight(toUpperCase, 'getName')\n * getUpperCaseName: () => string;\n *\n * getName() {\n * return this.name;\n * }\n * }\n *\n * const myClass = new MyClass();\n *\n * myClass.getUpperCaseName(); // => 'TED'\n */\nexport function FlowRight(...fns: ResolvableFunction[]): LodashDecorator {\n return decorator(...fns);\n}\nexport { FlowRight as flowRight };\nexport default decorator;\n"]}
\No newline at end of file