Skip to content

Commit 731fe66

Browse files
committed
allow to resolve promise to undefined
1 parent b1ccc0c commit 731fe66

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/bundler-plugin-core/src/plugins/sourcemap-deletion.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface FileDeletionPlugin {
1111
waitUntilSourcemapFileDependenciesAreFreed: () => Promise<void>;
1212
sentryScope: Scope;
1313
sentryClient: Client;
14-
filesToDeleteAfterUpload: string | string[] | Promise<string | string[]> | undefined;
14+
filesToDeleteAfterUpload: string | string[] | Promise<string | string[] | undefined> | undefined;
1515
logger: Logger;
1616
}
1717

@@ -27,9 +27,8 @@ export function fileDeletionPlugin({
2727
name: "sentry-file-deletion-plugin",
2828
async writeBundle() {
2929
try {
30-
if (filesToDeleteAfterUpload !== undefined) {
31-
const filesToDelete = await filesToDeleteAfterUpload;
32-
30+
const filesToDelete = await filesToDeleteAfterUpload;
31+
if (filesToDelete !== undefined) {
3332
const filePathsToDelete = await glob(filesToDelete, {
3433
absolute: true,
3534
nodir: true,

packages/bundler-plugin-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export interface Options {
138138
*
139139
* Use the `debug` option to print information about which files end up being deleted.
140140
*/
141-
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[]>;
141+
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
142142
};
143143

144144
/**

0 commit comments

Comments
 (0)