We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ae4bb7 commit 05cc282Copy full SHA for 05cc282
ad-server-cache-bun/src/ads.ts
@@ -81,17 +81,18 @@ export class AdMetadataStore {
81
if (!results) {
82
return [];
83
}
84
- return results.map(([error, hash]) => {
+ return results.reduce((acc: Array<AdMetadata>, [error, hash]) => {
85
if (error) {
86
throw error;
87
88
if (!hash) {
89
- return null;
+ return acc;
90
91
if (!Value.Check(AdMetadata, hash)) {
92
93
94
- return hash;
95
- }).filter((hash) => hash !== null) as Array<AdMetadata>;
+ acc.push(hash);
96
+ }, []);
97
98
0 commit comments