Skip to content

Commit

Permalink
fix-data-conversion-bug (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
dionjwa authored Jan 14, 2025
1 parent ae2a39d commit 606ef94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/libs/src/metapage/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ export const valueToFile = async (value: any, fileName: string, options?: FilePr
if (typeof(value) === "string") {
var blob = new Blob([value], { type: 'text/plain' });
options.type = "text/plain";
new File([blob], fileName, options);
return new File([blob], fileName, options);
}
if (typeof(value) === "object") {
const blob = new Blob([JSON.stringify(value)], {
type: 'application/json',
});
options.type = "application/json";
new File([blob], fileName, options);
return new File([blob], fileName, options);
}

// assume it's a string
Expand Down

0 comments on commit 606ef94

Please sign in to comment.