Skip to content

Commit

Permalink
Merge pull request #644 from balena-io/migrator-typings
Browse files Browse the repository at this point in the history
Fix async migrator typings when mixing migrator fns and sql
  • Loading branch information
Page- authored Feb 27, 2023
2 parents 2e19c45 + 8432b11 commit fefef91
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/migrator/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export type AsyncMigrationFn = (
) => Resolvable<Result>;

type AddFn<T extends {}, x extends 'sync' | 'async'> = T & {
syncFn: MigrationFn;
asyncFn: AsyncMigrationFn;
[key in `${x}Fn`]: key extends 'syncFn' ? MigrationFn : AsyncMigrationFn;
} & {
[key in `${x}Sql`]?: undefined;
};
Expand Down

0 comments on commit fefef91

Please sign in to comment.