@whatwg-node/node-fetch 0.4.13-alpha-20230821130056-5e4e382 → 0.4.13-alpha-20230821132128-700c49e
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/cjs/FormData.js +3 -12
- package/esm/FormData.js +3 -12
- package/package.json +1 -1
package/cjs/FormData.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getStreamFromFormData = exports.PonyfillFormData = void 0;
|
4
|
-
const File_js_1 = require("./File.js");
|
5
4
|
const ReadableStream_js_1 = require("./ReadableStream.js");
|
6
5
|
class PonyfillFormData {
|
7
6
|
constructor() {
|
@@ -118,17 +117,9 @@ function getStreamFromFormData(formData, boundary = '---') {
|
|
118
117
|
}
|
119
118
|
exports.getStreamFromFormData = getStreamFromFormData;
|
120
119
|
function getNormalizedFile(name, blob, fileName) {
|
121
|
-
|
122
|
-
|
123
|
-
return new File_js_1.PonyfillFile([blob], fileName, {
|
124
|
-
type: blob.type,
|
125
|
-
lastModified: blob.lastModified,
|
126
|
-
});
|
127
|
-
}
|
128
|
-
return blob;
|
129
|
-
}
|
130
|
-
return new File_js_1.PonyfillFile([blob], fileName || name, { type: blob.type });
|
120
|
+
blob.name = fileName || blob.name || name;
|
121
|
+
return blob;
|
131
122
|
}
|
132
123
|
function isBlob(value) {
|
133
|
-
return value != null
|
124
|
+
return value?.arrayBuffer != null;
|
134
125
|
}
|
package/esm/FormData.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { PonyfillFile } from './File.js';
|
2
1
|
import { PonyfillReadableStream } from './ReadableStream.js';
|
3
2
|
export class PonyfillFormData {
|
4
3
|
constructor() {
|
@@ -113,17 +112,9 @@ export function getStreamFromFormData(formData, boundary = '---') {
|
|
113
112
|
});
|
114
113
|
}
|
115
114
|
function getNormalizedFile(name, blob, fileName) {
|
116
|
-
|
117
|
-
|
118
|
-
return new PonyfillFile([blob], fileName, {
|
119
|
-
type: blob.type,
|
120
|
-
lastModified: blob.lastModified,
|
121
|
-
});
|
122
|
-
}
|
123
|
-
return blob;
|
124
|
-
}
|
125
|
-
return new PonyfillFile([blob], fileName || name, { type: blob.type });
|
115
|
+
blob.name = fileName || blob.name || name;
|
116
|
+
return blob;
|
126
117
|
}
|
127
118
|
function isBlob(value) {
|
128
|
-
return value != null
|
119
|
+
return value?.arrayBuffer != null;
|
129
120
|
}
|
package/package.json
CHANGED