Skip to content

Commit

Permalink
add s3fs class /2
Browse files Browse the repository at this point in the history
  • Loading branch information
ricsam committed Dec 16, 2024
1 parent 639e0c7 commit dc51150
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/backends/local/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export const createLinkFs = <T>(uri: `file://${string}`, fs: T): T => {
]);
return lfs;
};
export const createFileFs = (uri: `file://${string}`) => {
export function createFileFs(uri: `file://${string}`): typeof realfs {
return createLinkFs(uri, realfs);
};
}
8 changes: 4 additions & 4 deletions src/backends/s3/s3fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {
PutObjectCommand,
S3Client,
} from '@aws-sdk/client-s3';
import stream from 'node:stream';
import stream, { Writable } from 'node:stream';
import { createS3Client } from './create-s3-client';
import { ParsedS3Uri, parseS3Uri } from './parse-s3-uri';
import { createWriteStream } from './create-write-stream';
import { ParsedS3Uri, parseS3Uri } from './parse-s3-uri';

class S3BaseFs {
protected client: S3Client;
Expand Down Expand Up @@ -130,8 +130,8 @@ export class S3PromiseFs extends S3BaseFs {
}

export class S3Fs extends S3BaseFs {
public promises = new S3PromiseFs(this.bucketUri);
public createWriteStream(path: string) {
public promises: S3PromiseFs = new S3PromiseFs(this.bucketUri);
public createWriteStream(path: string): Writable {
const { bucket, key } = this.normalizePath(path);
return createWriteStream(this.client, bucket, key);
}
Expand Down

0 comments on commit dc51150

Please sign in to comment.