Skip to content

Commit e2ab318

Browse files
committed
Update the extract-files dependency.
1 parent 7816e03 commit e2ab318

4 files changed

Lines changed: 8 additions & 10 deletions

File tree

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Major
66

7+
- Updated the [`extract-files`](https://npm.im/extract-files) dependency.
78
- Updated the [`react-waterfall-render`](https://npm.im/react-waterfall-render) dependency.
89
- Implemented TypeScript types via JSDoc comments, fixing [#6](https://github.com/jaydenseric/graphql-react/issues/6).
910

fetchOptionsGraphQL.mjs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// @ts-check
22

3-
import extractFiles from "extract-files/public/extractFiles.js";
3+
import extractFiles from "extract-files/extractFiles.mjs";
4+
import isExtractableFile from "extract-files/isExtractableFile.mjs";
45

56
/** @typedef {import("./types.mjs").GraphQLOperation} GraphQLOperation */
67

@@ -27,12 +28,8 @@ export default function fetchOptionsGraphQL(operation) {
2728
},
2829
};
2930

30-
const result = extractFiles(operation);
31-
32-
/** @type {Map<File | Blob, Array<string>>} */
33-
const files = result.files;
34-
35-
const operationJSON = JSON.stringify(result.clone);
31+
const { clone, files } = extractFiles(operation, isExtractableFile);
32+
const operationJSON = JSON.stringify(clone);
3633

3734
if (files.size) {
3835
// See the GraphQL multipart request spec:
@@ -56,7 +53,7 @@ export default function fetchOptionsGraphQL(operation) {
5653
form.set(
5754
`${++i}`,
5855
file,
59-
// @ts-ignore It’s ok to be undefined for a `Blob` instance.
56+
// @ts-ignore It’s ok for `name` to be undefined for a `Blob` instance.
6057
file.name
6158
);
6259
});

fetchOptionsGraphQL.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default (tests) => {
1616
tests.add("`fetchOptionsGraphQL` bundle size.", async () => {
1717
await assertBundleSize(
1818
new URL("./fetchOptionsGraphQL.mjs", import.meta.url),
19-
1200
19+
800
2020
);
2121
});
2222

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"react-dom": "16.14 - 17"
103103
},
104104
"dependencies": {
105-
"extract-files": "^11.0.0",
105+
"extract-files": "^12.0.0",
106106
"react-waterfall-render": "^4.0.0"
107107
},
108108
"devDependencies": {

0 commit comments

Comments
 (0)