Skip to content

Commit 7439b32

Browse files
committed
fix types
1 parent b8b17f1 commit 7439b32

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

internal-packages/testcontainers/src/docker.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,15 @@ export async function getDockerNetworkAttachments(): Promise<DockerNetworkAttach
4848

4949
const lines = stringToLines(result.stdout);
5050

51-
networks = lines.map((line) => {
51+
for (const line of lines) {
5252
const [id, name] = lineToWords(line);
53-
return { id, name };
54-
});
53+
54+
if (!id || !name) {
55+
continue;
56+
}
57+
58+
networks.push({ id, name });
59+
}
5560
} catch (err) {
5661
console.error("Failed to list docker networks:", err);
5762
}
@@ -97,10 +102,15 @@ export async function getDockerContainerNetworks(): Promise<DockerContainerNetwo
97102

98103
const lines = stringToLines(result.stdout);
99104

100-
containers = lines.map((line) => {
105+
for (const line of lines) {
101106
const [id, name] = lineToWords(line);
102-
return { id, name };
103-
});
107+
108+
if (!id || !name) {
109+
continue;
110+
}
111+
112+
containers.push({ id, name });
113+
}
104114
} catch (err) {
105115
console.error("Failed to list docker containers:", err);
106116
}

internal-packages/testcontainers/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"skipLibCheck": true,
1414
"noEmit": true,
1515
"strict": true,
16+
"noUncheckedIndexedAccess": true,
1617
"paths": {
1718
"@trigger.dev/core": ["../../packages/core/src/index"],
1819
"@trigger.dev/core/*": ["../../packages/core/src/*"],

0 commit comments

Comments
 (0)