Latest
function promisify
import { promisify } from "https://dotland.deno.dev/x/kafkasaur@v0.0.7/src/utils/promisify.ts";

Promisifies a given function that has a final callback argument.

Type Parameters

T extends (...args: any[]) => any
optional
$FirstParams extends unknown[] = Parameters<T> extends [...infer $FirstParams, infer _] ? $FirstParams : any[]

Returns

(...args: $FirstParams) => Promise<Parameters<T> extends [...infer _, infer $Last] ? $Last : any>