Skip to content

Commit 55ae27d

Browse files
committed
fix(fs): actually expose write options for .write
1 parent 15cb99d commit 55ae27d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/fs/src/fs.abstraction.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Readable } from 'stream';
2-
import { FileInfo, FileSystem } from '@chunkd/core';
2+
import { FileInfo, FileSystem, WriteOptions } from '@chunkd/core';
33

44
export type FileWriteTypes = Buffer | Readable | string | Record<string, unknown> | Array<unknown>;
55

@@ -75,11 +75,11 @@ export class FileSystemAbstraction {
7575
* @param filePath file to write
7676
* @param buffer buffer or stream to write
7777
*/
78-
write(filePath: string, buffer: FileWriteTypes): Promise<void> {
78+
write(filePath: string, buffer: FileWriteTypes, opts?: WriteOptions): Promise<void> {
7979
if (Array.isArray(buffer) || isRecord(buffer)) {
80-
return this.get(filePath).write(filePath, JSON.stringify(buffer, null, 2));
80+
return this.get(filePath).write(filePath, JSON.stringify(buffer, null, 2), opts);
8181
}
82-
return this.get(filePath).write(filePath, buffer);
82+
return this.get(filePath).write(filePath, buffer, opts);
8383
}
8484

8585
/**

0 commit comments

Comments
 (0)