We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 08de642 + 861b0e7 commit 3d97746Copy full SHA for 3d97746
src/drive.ts
@@ -145,8 +145,15 @@ export class FileSystemDrive implements Contents.IDrive {
145
146
const handle = await root.getFileHandle(localPath);
147
const writable = await handle.createWritable({});
148
+
149
+ const format = options?.format;
150
const content = options?.content;
- await writable.write(content);
151
+ if (format === 'json') {
152
+ const data = JSON.stringify(content, null, 2);
153
+ await writable.write(data);
154
+ } else {
155
+ await writable.write(content);
156
+ }
157
await writable.close();
158
return this.get(localPath);
159
}
0 commit comments