Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
alt-nodejs16
/
root
/
lib
/
node_modules
/
npm
/
node_modules
/
agent-base
/
src
/
File Content:
promisify.ts
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); } } ); }); }; }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
index.ts
9018 bytes
0644
promisify.ts
649 bytes
0644
N4ST4R_ID | Naxtarrr