@whatwg-node/node-fetch 0.0.1-alpha-20230130162825-1e02017 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Body.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
- import { PonyfillBlob } from './Blob';
3
2
  import { Readable } from 'stream';
3
+ import { PonyfillBlob } from './Blob';
4
4
  import { PonyfillFormData } from './FormData';
5
5
  import { PonyfillReadableStream } from './ReadableStream';
6
6
  export type BodyPonyfillInit = XMLHttpRequestBodyInit | Readable | PonyfillReadableStream<Uint8Array>;
package/Request.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PonyfillBody, BodyPonyfillInit, PonyfillBodyOptions } from './Body';
1
+ import { BodyPonyfillInit, PonyfillBody, PonyfillBodyOptions } from './Body';
2
2
  import { PonyfillHeadersInit } from './Headers';
3
3
  export type RequestPonyfillInit = PonyfillBodyOptions & Omit<RequestInit, 'body' | 'headers'> & {
4
4
  body?: BodyPonyfillInit | null;
package/Response.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PonyfillBody, BodyPonyfillInit, PonyfillBodyOptions } from './Body';
1
+ import { BodyPonyfillInit, PonyfillBody, PonyfillBodyOptions } from './Body';
2
2
  import { PonyfillHeadersInit } from './Headers';
3
3
  export type ResponsePonyfilInit = PonyfillBodyOptions & Omit<ResponseInit, 'headers'> & {
4
4
  url?: string;
package/index.js CHANGED
@@ -4,14 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
+ const fs = require('fs');
7
8
  const http = require('http');
8
9
  const https = require('https');
9
- const events = require('@whatwg-node/events');
10
- const buffer = require('buffer');
11
10
  const stream = require('stream');
12
- const busboy = _interopDefault(require('busboy'));
13
11
  const url = require('url');
14
- const fs = require('fs');
12
+ const events = require('@whatwg-node/events');
13
+ const busboy = _interopDefault(require('busboy'));
14
+ const buffer = require('buffer');
15
15
 
16
16
  // Will be removed after v14 reaches EOL
17
17
  class PonyfillAbortError extends Error {
@@ -30,6 +30,7 @@ class PonyfillAbortError extends Error {
30
30
  }
31
31
  }
32
32
 
33
+ // Will be removed after v14 reaches EOL
33
34
  class PonyfillAbortSignal extends events.EventTarget {
34
35
  constructor() {
35
36
  super(...arguments);
@@ -327,7 +328,10 @@ class PonyfillFormData {
327
328
  function getNormalizedFile(name, blob, fileName) {
328
329
  if (blob instanceof PonyfillFile) {
329
330
  if (fileName != null) {
330
- return new PonyfillFile([blob], fileName, { type: blob.type, lastModified: blob.lastModified });
331
+ return new PonyfillFile([blob], fileName, {
332
+ type: blob.type,
333
+ lastModified: blob.lastModified,
334
+ });
331
335
  }
332
336
  return blob;
333
337
  }
package/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
+ import { createReadStream } from 'fs';
1
2
  import { request as request$1 } from 'http';
2
3
  import { request } from 'https';
3
- import { EventTarget, CustomEvent } from '@whatwg-node/events';
4
- import { Blob } from 'buffer';
5
4
  import { Readable } from 'stream';
6
- import busboy from 'busboy';
7
5
  import { fileURLToPath } from 'url';
8
- import { createReadStream } from 'fs';
6
+ import { EventTarget, CustomEvent } from '@whatwg-node/events';
7
+ import busboy from 'busboy';
8
+ import { Blob } from 'buffer';
9
9
 
10
10
  // Will be removed after v14 reaches EOL
11
11
  class PonyfillAbortError extends Error {
@@ -24,6 +24,7 @@ class PonyfillAbortError extends Error {
24
24
  }
25
25
  }
26
26
 
27
+ // Will be removed after v14 reaches EOL
27
28
  class PonyfillAbortSignal extends EventTarget {
28
29
  constructor() {
29
30
  super(...arguments);
@@ -321,7 +322,10 @@ class PonyfillFormData {
321
322
  function getNormalizedFile(name, blob, fileName) {
322
323
  if (blob instanceof PonyfillFile) {
323
324
  if (fileName != null) {
324
- return new PonyfillFile([blob], fileName, { type: blob.type, lastModified: blob.lastModified });
325
+ return new PonyfillFile([blob], fileName, {
326
+ type: blob.type,
327
+ lastModified: blob.lastModified,
328
+ });
325
329
  }
326
330
  return blob;
327
331
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.0.1-alpha-20230130162825-1e02017",
3
+ "version": "0.0.1",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {