Skip to content

Commit 8efebce

Browse files
committed
fix: incorrect type definitions
1 parent 8c1f79b commit 8efebce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/database.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export enum SqlDumpType {
1212

1313
export interface SqlDumpDetails {
1414
type: SqlDumpType;
15-
sourceDb: string;
15+
sourceDb: string | undefined;
1616
}
1717

1818
export const getSqlDumpDetails = async ( filePath: string ): Promise< SqlDumpDetails > => {
@@ -33,7 +33,7 @@ export const getSqlDumpDetails = async ( filePath: string ): Promise< SqlDumpDet
3333
} );
3434

3535
let isMyDumper = false;
36-
let sourceDB = '';
36+
let sourceDB: string | undefined = '';
3737
let currentLineNumber = 0;
3838

3939
for await ( const line of readLine ) {
@@ -43,8 +43,8 @@ export const getSqlDumpDetails = async ( filePath: string ): Promise< SqlDumpDet
4343

4444
const metadataMatch = /^-- metadata.header /.exec( line );
4545

46-
const sourceDBMatch = /^-- (.*)-schema-create.sql/.exec( line ) ?? [];
47-
const sourceDBName = sourceDBMatch[ 1 ];
46+
const sourceDBMatch = /^-- (.*)-schema-create.sql/.exec( line );
47+
const sourceDBName = sourceDBMatch?.[ 1 ];
4848

4949
if ( metadataMatch && ! isMyDumper ) {
5050
isMyDumper = true;

0 commit comments

Comments
 (0)