From c9f30bffef8ee16035293811a40680c8714aea42 Mon Sep 17 00:00:00 2001 From: Bauke Date: Thu, 3 Mar 2022 22:17:04 +0100 Subject: [PATCH] Make the default skip use <= instead. --- source/migration-helper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/migration-helper.ts b/source/migration-helper.ts index d4574c3..fb9df3a 100644 --- a/source/migration-helper.ts +++ b/source/migration-helper.ts @@ -19,7 +19,7 @@ export type Migration = { * tested, while the second argument will be the version passed into * {@link migrate}. * - * If left undefined, `a < b` will be used. This works for {@link Date dates}, + * If left undefined, `a <= b` will be used. This works for {@link Date dates}, * {@link Number numbers} and {@link String strings}. So if you want to use a * different type for versioning you should create your own function. */ @@ -35,7 +35,7 @@ export async function migrate( data: unknown, version: V, migrations: Array>, - skip: SkipMigrationFn = (a, b) => a < b, + skip: SkipMigrationFn = (a, b) => a <= b, ): Promise { let migratedData = data;