diff --git a/source/migration-helper.ts b/source/migration-helper.ts index fb9df3a..61bc7a2 100644 --- a/source/migration-helper.ts +++ b/source/migration-helper.ts @@ -7,9 +7,9 @@ * The migrate function should take the data you pass through {@link migrate} * and modify it to your needs. */ -export type Migration = { +export type Migration = { version: V; - migrate: (data: any) => Promise; + migrate: (data: A) => Promise; }; /** diff --git a/tests/date.test.ts b/tests/date.test.ts index f4c0b71..0e53c79 100644 --- a/tests/date.test.ts +++ b/tests/date.test.ts @@ -3,7 +3,7 @@ import test from 'ava'; import {migrate, Migration} from '../source/migration-helper.js'; test('migrate', async (t) => { - const migrations: Array> = [ + const migrations: Array> = [ { version: new Date('2022-01-01'), migrate: async (data: string) => `${data} migrated`, diff --git a/tests/number.test.ts b/tests/number.test.ts index 209a2d9..dcf14d4 100644 --- a/tests/number.test.ts +++ b/tests/number.test.ts @@ -3,7 +3,7 @@ import test from 'ava'; import {migrate, Migration} from '../source/migration-helper.js'; test('migrate', async (t) => { - const migrations: Array> = [ + const migrations: Array> = [ { version: 5, migrate: async (data: string) => `${data} migrated`, diff --git a/tests/object.test.ts b/tests/object.test.ts index 513590a..55a9475 100644 --- a/tests/object.test.ts +++ b/tests/object.test.ts @@ -12,7 +12,7 @@ test('migrate<{custom: number}>', async (t) => { }; const skip: SkipMigrationFn = (a, b) => a.custom > b.custom; - const migrations: Array> = [ + const migrations: Array> = [ { version: {custom: 5}, migrate: async (data: string) => `${data} migrated`, diff --git a/tests/string.test.ts b/tests/string.test.ts index 49e446a..f800309 100644 --- a/tests/string.test.ts +++ b/tests/string.test.ts @@ -3,7 +3,7 @@ import test from 'ava'; import {migrate, Migration} from '../source/migration-helper.js'; test('migrate', async (t) => { - const migrations: Array> = [ + const migrations: Array> = [ { version: '0.2.4', migrate: async (data: string) => `${data} migrated`,