-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add typescript support #8
Conversation
@@ -159,27 +162,28 @@ exports.read = function (response, encoding) { | |||
} | |||
|
|||
return new Promise((resolve, reject) => { | |||
const makeReadTimeoutError = (err) => { | |||
const makeReadTimeoutError = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样改的话,就不知道 err 对象是具体哪个阶段生成的了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有堆栈的吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
堆栈永远在 makeReadTimeoutError
这个函数里,之前分散到各个调用 makeReadTimeoutError
的地方是为了看到 error 是由哪里产生的吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方不是异步操作 栈应该ok 的。
lib/index.d.ts
Outdated
'data'?: string|Buffer|undefined; | ||
} | ||
|
||
export function request<T>(url: string, options: Options): Promise<IncomingMessage>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的泛型 <T>
好像没有作用?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
更新了 |
No description provided.