Rename to migrateV1ToV3

This commit is contained in:
Alexander Farber 2026-01-21 11:47:38 +01:00 committed by Mingholy
parent 273caf1cde
commit efb1eb37a2

View file

@ -289,11 +289,11 @@ export function needsMigration(settings: Record<string, unknown>): boolean {
} }
/** /**
* Migrates V1 (flat) settings directly to the latest version (V3). * Migrates V1 (flat) settings directly to V3.
* This includes both structural migration (flat -> nested) and boolean * This includes both structural migration (flat -> nested) and boolean
* inversion (disable* -> enable*), so migrateV2ToV3 will be skipped. * inversion (disable* -> enable*), so migrateV2ToV3 will be skipped.
*/ */
function migrateV1ToLatest( function migrateV1ToV3(
flatSettings: Record<string, unknown>, flatSettings: Record<string, unknown>,
): Record<string, unknown> | null { ): Record<string, unknown> | null {
if (!needsMigration(flatSettings)) { if (!needsMigration(flatSettings)) {
@ -948,7 +948,7 @@ export function loadSettings(
let settingsObject = rawSettings as Record<string, unknown>; let settingsObject = rawSettings as Record<string, unknown>;
if (needsMigration(settingsObject)) { if (needsMigration(settingsObject)) {
const migratedSettings = migrateV1ToLatest(settingsObject); const migratedSettings = migrateV1ToV3(settingsObject);
if (migratedSettings) { if (migratedSettings) {
if (MIGRATE_V2_OVERWRITE) { if (MIGRATE_V2_OVERWRITE) {
try { try {