Skip to content

Commit

Permalink
Merge pull request #50 from samchon/feature/file
Browse files Browse the repository at this point in the history
Fix samchon/nestia#1018: `HttpMigrateRouteFetcher` for React Native.
  • Loading branch information
samchon authored Sep 17, 2024
2 parents 6b55172 + 4518449 commit 1c87c42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samchon/openapi",
"version": "1.0.1",
"version": "1.0.2",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",
"main": "./lib/index.js",
"module": "./lib/index.mjs",
Expand Down
7 changes: 3 additions & 4 deletions src/http/HttpMigrateRouteFetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,9 @@ const requestFormDataBody = (input: Record<string, any>): FormData => {
const encoded: FormData = new FormData();
const append = (key: string) => (value: any) => {
if (value === undefined) return;
else if (value instanceof Blob)
if (value instanceof File) encoded.append(key, value, value.name);
else encoded.append(key, value);
else encoded.append(key, String(value));
else if (typeof File === "function" && value instanceof File)
encoded.append(key, value, value.name);
else encoded.append(key, value);
};
for (const [key, value] of Object.entries(input))
if (Array.isArray(value)) value.map(append(key));
Expand Down

0 comments on commit 1c87c42

Please sign in to comment.