Skip to content
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

fix: import BodyReadable and Dispatcher correctly #1424

Merged
merged 3 commits into from May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/types/readable.test-d.ts
@@ -1,5 +1,5 @@
import { expectAssignable } from 'tsd'
import BodyReadable from '../../types/readable'
import BodyReadable = require('../../types/readable')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible for us to test both ways? I want to ensure we are not breaking allowSyntheticDefaultImports=true users

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is! There is no impact for configurations with the setting enabled.

import { Blob } from 'buffer'

expectAssignable<BodyReadable>(new BodyReadable())
Expand Down
2 changes: 1 addition & 1 deletion types/dispatcher.d.ts
Expand Up @@ -3,7 +3,7 @@ import { Duplex, Readable, Writable } from 'stream'
import { EventEmitter } from 'events'
import { IncomingHttpHeaders } from 'http'
import { Blob } from 'buffer'
import BodyReadable from './readable'
import BodyReadable = require('./readable')
import { FormData } from './formdata'

type AbortSignal = unknown;
Expand Down
2 changes: 1 addition & 1 deletion types/mock-interceptor.d.ts
@@ -1,5 +1,5 @@
import { IncomingHttpHeaders } from 'http'
import Dispatcher from './dispatcher';
import Dispatcher = require('./dispatcher');
import { BodyInit, Headers } from './fetch'

export {
Expand Down