Skip to content

Commit 934af50

Browse files
committed
addressing commends
1 parent 91c6d04 commit 934af50

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/storage.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,8 +1361,8 @@ export class Storage extends Service {
13611361
.map((fullPath: string) => {
13621362
const name = fullPath.split('/').pop();
13631363
if (!name) return null;
1364-
const exists = buckets.some(
1365-
(bucket: Bucket) => bucket.name === name
1364+
const exists = new Set(buckets.map((b: Bucket) => b.name)).has(
1365+
name
13661366
);
13671367
if (!exists) {
13681368
const placeholder = this.bucket(name);
@@ -1374,13 +1374,13 @@ export class Storage extends Service {
13741374
})
13751375
.filter(Boolean) as Bucket[];
13761376
}
1377-
const allBuckets = [...buckets, ...unreachableBuckets];
1377+
const results = [...buckets, ...unreachableBuckets];
13781378

13791379
const nextQuery = resp.nextPageToken
13801380
? Object.assign({}, options, {pageToken: resp.nextPageToken})
13811381
: null;
13821382

1383-
callback(null, allBuckets, nextQuery, resp);
1383+
callback(null, results, nextQuery, resp);
13841384
}
13851385
);
13861386
}

0 commit comments

Comments
 (0)