Skip to content

Commit 8930ba6

Browse files
committed
up
1 parent 7929ba9 commit 8930ba6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/scripts/shared.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ export async function getResults(
125125

126126
// Only applied in bundle mode, a shortcut to get single entry result
127127
if (libConfig.bundle !== false && fileSet.length) {
128-
let entryFile = '';
128+
let entryFile: string | undefined;
129129
if (fileSet.length === 1) {
130-
entryFile = fileSet[0]!;
130+
entryFile = fileSet[0];
131131
} else {
132-
entryFile = fileSet.find((file) => file.includes('index'))!;
132+
entryFile = fileSet.find((file) => file.includes('index'));
133133
}
134134

135-
entries[key] = content[entryFile]!;
136-
entryFiles[key] = normalize(entryFile);
135+
if (typeof entryFile === 'string') {
136+
entries[key] = content[entryFile]!;
137+
entryFiles[key] = normalize(entryFile);
138+
}
137139
}
138140
}
139141

0 commit comments

Comments
 (0)