download
raw
649 Bytes
import {
Agent,
ClientRequest,
RequestOptions,
AgentCallbackCallback,
AgentCallbackPromise,
AgentCallbackReturn
} from './index';
type LegacyCallback = (
req: ClientRequest,
opts: RequestOptions,
fn: AgentCallbackCallback
) => void;
export default function promisify(fn: LegacyCallback): AgentCallbackPromise {
return function(this: Agent, req: ClientRequest, opts: RequestOptions) {
return new Promise((resolve, reject) => {
fn.call(
this,
req,
opts,
(err: Error | null | undefined, rtn?: AgentCallbackReturn) => {
if (err) {
reject(err);
} else {
resolve(rtn);
}
}
);
});
};
}

Xet Storage Details

Size:
649 Bytes
·
Xet hash:
98fb89abf8ae075c2cf40a5139d664806611fa9eaf4d139c7443bf2733313a84

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.