Skip to content

Commit

Permalink
Fix s3 typings
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Oct 4, 2024
1 parent d7f0d7e commit af25d63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/actors/storage/denoKv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ export class DenoKvActorStorage implements ActorStorage {
);

for await (const entry of iter) {
console.log(entry);
result.push([(entry.key as string[]).slice(-2), entry.value]);
}

Expand Down
10 changes: 8 additions & 2 deletions src/actors/storage/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ export class S3ActorStorage implements ActorStorage {
}

// Overloaded delete methods
async delete(
key: string,
options?: ActorStoragePutOptions,
): Promise<boolean>;
async delete(
key: string[],
options?: ActorStoragePutOptions,
Expand All @@ -137,7 +141,7 @@ export class S3ActorStorage implements ActorStorage {
options?: ActorStoragePutOptions,
): Promise<number>;
async delete(
keyOrKeys: string[] | string[][],
keyOrKeys: string | string[] | string[][],
_options?: ActorStoragePutOptions,
): Promise<boolean | number> {
if (Array.isArray(keyOrKeys[0])) {
Expand All @@ -155,7 +159,9 @@ export class S3ActorStorage implements ActorStorage {
return deletedCount;
} else {
// key: string[]
const keyParts = keyOrKeys as string[];
const keyParts = typeof keyOrKeys === "string"
? [keyOrKeys]
: keyOrKeys as string[];
const key = this.buildKey(keyParts);
const response = await this.deleteObject(key);
await response.body?.cancel();
Expand Down

0 comments on commit af25d63

Please sign in to comment.