UNPKG

ambi

Version:

Ambi lets you execute any function ambidextrously; providing you the ability to execute any function (be it synchronous, asynchronous, returns, callbacks, promises) as if it returned a promise.

9 lines 506 B
/** * Ambidextrously execute the method with the passed arguments. * If method.length > args.length, then ambi provides the method with a completion callback as the last expected argument. * @param method A method, that can either resolve synchronously, via a promise, or via a callback. * @param args The arguments to provide the function. * @returns The determined result. */ export default function ambi<Result>(method: Function, ...args: any): Promise<Result>; //# sourceMappingURL=index.d.ts.map