From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 22 Dec 2017 15:05:32 +0100 Subject: Apply prettier config --- packages/utils/src/promisify.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'packages/utils/src/promisify.ts') diff --git a/packages/utils/src/promisify.ts b/packages/utils/src/promisify.ts index c114cf32f..29d626b61 100644 --- a/packages/utils/src/promisify.ts +++ b/packages/utils/src/promisify.ts @@ -5,16 +5,11 @@ import * as _ from 'lodash'; * Promisify provides a default callback of the form (error, result) and rejects when `error` is not null. You can also * supply thisArg object as the second argument which will be passed to `apply`. */ -export function promisify( - originalFn: ( - ...args: any[], - // HACK: This can't be properly typed without variadic kinds https://github.com/Microsoft/TypeScript/issues/5453 - ) => void, - thisArg?: any, -): (...callArgs: any[]) => Promise { +// HACK: This can't be properly typed without variadic kinds https://github.com/Microsoft/TypeScript/issues/5453 +export function promisify(originalFn: (...args: any[]) => void, thisArg?: any): (...callArgs: any[]) => Promise { const promisifiedFunction = async (...callArgs: any[]): Promise => { return new Promise((resolve, reject) => { - const callback = (err: Error|null, data?: T) => { + const callback = (err: Error | null, data?: T) => { _.isNull(err) ? resolve(data) : reject(err); }; originalFn.apply(thisArg, [...callArgs, callback]); -- cgit v1.2.3