Skip to content

Commit 58defb8

Browse files
committed
chore: use reduce instead of array spread
1 parent 9390053 commit 58defb8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/keyring-sdk/src/migration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export function isVersionedState<State extends Json = Json>(
175175
export function getLatestVersion(
176176
migrations: readonly KeyringMigration[],
177177
): number {
178-
return Math.max(0, ...migrations.map((migration) => migration.version));
178+
return migrations.reduce((max, { version }) => Math.max(max, version), 0);
179179
}
180180

181181
/**

0 commit comments

Comments
 (0)