Skip to content

Commit

Permalink
fix import rule for stream PassThrough
Browse files Browse the repository at this point in the history
  • Loading branch information
David Frank committed Nov 5, 2018
1 parent 8cc909f commit d935121
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,10 @@ Changelog

# 2.x release

## master

- Fix: `import` on index.js, where `PassThrough` doesn't have a named export when using with node <10 and `--exerimental-modules` flag.

## v2.2.0

- Enhance: Support all `ArrayBuffer` view types
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Expand Up @@ -11,14 +11,17 @@ import { resolve as resolve_url } from 'url';
import http from 'http';
import https from 'https';
import zlib from 'zlib';
import { PassThrough } from 'stream';
import Stream from 'stream';

import Body, { writeToStream, getTotalBytes } from './body';
import Response from './response';
import Headers, { createHeadersLenient } from './headers';
import Request, { getNodeRequestOptions } from './request';
import FetchError from './fetch-error';

// fix an issue where PassThrough isn't a named export for node <10
const PassThrough = Stream.PassThrough;

/**
* Fetch function
*
Expand Down

0 comments on commit d935121

Please sign in to comment.