aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-10 21:22:51 +0800
committerFabio Berger <me@fabioberger.com>2018-05-10 21:22:51 +0800
commit13a61db2896074a939baa1769abef4c4917d4354 (patch)
tree5e91f3aa705a3c7f03bef7c94cb9a7441702bd60 /packages/dev-utils
parent93b74cc766523173c055f0882471d552cfa03271 (diff)
downloaddexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar.gz
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar.bz2
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar.lz
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar.xz
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.tar.zst
dexon-sol-tools-13a61db2896074a939baa1769abef4c4917d4354.zip
Add var returns
Diffstat (limited to 'packages/dev-utils')
-rw-r--r--packages/dev-utils/src/callback_error_reporter.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/dev-utils/src/callback_error_reporter.ts b/packages/dev-utils/src/callback_error_reporter.ts
index 874343ccc..c8e693673 100644
--- a/packages/dev-utils/src/callback_error_reporter.ts
+++ b/packages/dev-utils/src/callback_error_reporter.ts
@@ -7,7 +7,7 @@ const expect = chai.expect;
export const callbackErrorReporter = {
reportNoErrorCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) {
- return <T>(f?: (value: T) => void) => {
+ const callback = <T>(f?: (value: T) => void) => {
const wrapped = (value: T) => {
if (_.isUndefined(f)) {
done();
@@ -24,9 +24,10 @@ export const callbackErrorReporter = {
};
return wrapped;
};
+ return callback;
},
reportNodeCallbackErrors(done: DoneCallback, expectToBeCalledOnce = true) {
- return <T>(f?: (value: T) => void) => {
+ const callback = <T>(f?: (value: T) => void) => {
const wrapped = (error: Error | null, value: T | undefined) => {
if (!_.isNull(error)) {
done(error);
@@ -47,6 +48,7 @@ export const callbackErrorReporter = {
};
return wrapped;
};
+ return callback;
},
assertNodeCallbackError(done: DoneCallback, errMsg: string) {
const wrapped = <T>(error: Error | null, value: T | undefined) => {