Skip to content

Commit

Permalink
fix(nestjs-tools-file-storage): restore GC serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Aug 7, 2024
1 parent 56b7417 commit e78b1c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/file-storage/src/lib/file-storage-google.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class FileStorageGoogle implements FileStorage {
// TODO: make default serializer compliant with the other readDir implementations
async readDir<R = string[]>(args: FileStorageGoogleReadDir<R>): Promise<R> {
const defaultSerializer = (res: GetFilesResponse) => {
return res[0].map((file: File) => file.name) as R;
return res[0].map((file: File) => (prefix ? file.name.replace(`${prefix}/`, '') : file.name)) as R;
};
const { storage, bucket } = this.config;
const { dirPath, request, serializer = defaultSerializer, options = {} } = args;
Expand Down

0 comments on commit e78b1c1

Please sign in to comment.