Skip to content

Commit 43c70db

Browse files
committed
Tweak type
1 parent b84b769 commit 43c70db

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/compass-collection/src/components/mock-data-generator-modal/script-generation-utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ export interface ScriptOptions {
2929
arrayLengthMap?: ArrayLengthMap;
3030
}
3131

32-
export interface ScriptResult {
33-
script: string;
34-
success: boolean;
35-
error?: string;
36-
}
32+
export type ScriptResult =
33+
| { script: string; success: true }
34+
| { error: string; success: false };
3735

3836
type DocumentStructure = {
3937
[fieldName: string]:
@@ -102,7 +100,6 @@ console.log(\`Successfully inserted \${documents.length} documents into ${escape
102100
};
103101
} catch (error) {
104102
return {
105-
script: '',
106103
success: false,
107104
error: error instanceof Error ? error.message : 'Unknown error',
108105
};

0 commit comments

Comments
 (0)