docs: remove implicit 'any' and 'Object' types from the docs (#19585)

* docs: remove implicit 'any' and 'Object' types from the docs

* docs: more docs improvements, remove all remaining empty interfaces

* chore: update tests for better types
This commit is contained in:
Samuel Attard 2019-08-05 10:45:58 -07:00 committed by GitHub
parent ee674acca4
commit cfd230d7f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 88 additions and 86 deletions

View file

@ -307,7 +307,7 @@ describe('net module', () => {
done()
})
})
urlRequest.setHeader(customHeaderName, customHeaderValue)
urlRequest.setHeader(customHeaderName, customHeaderValue as any)
expect(urlRequest.getHeader(customHeaderName)).to.equal(customHeaderValue)
expect(urlRequest.getHeader(customHeaderName.toLowerCase())).to.equal(customHeaderValue)
urlRequest.write('')
@ -975,7 +975,7 @@ describe('net module', () => {
expect(() => {
net.request({
url: 'https://foo',
session: 1
session: 1 as any
})
}).to.throw("`session` should be an instance of the Session class")
})
@ -984,7 +984,7 @@ describe('net module', () => {
expect(() => {
net.request({
url: 'https://foo',
partition: 1
partition: 1 as any
})
}).to.throw("`partition` should be a string")
})
@ -1001,7 +1001,7 @@ describe('net module', () => {
}).then(serverUrlUnparsed => {
const serverUrl = url.parse(serverUrlUnparsed)
const options = {
port: serverUrl.port,
port: serverUrl.port ? parseInt(serverUrl.port, 10) : undefined,
hostname: '127.0.0.1',
headers: { [customHeaderName]: customHeaderValue }
}