mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 04:00:36 +00:00
Rename migrateSettingsToV2 to migrateV1ToLatest
This commit is contained in:
parent
895cbf71cd
commit
273caf1cde
1 changed files with 7 additions and 2 deletions
|
|
@ -288,7 +288,12 @@ export function needsMigration(settings: Record<string, unknown>): boolean {
|
|||
return hasV1Keys || hasInvertedBooleanKeys;
|
||||
}
|
||||
|
||||
function migrateSettingsToV2(
|
||||
/**
|
||||
* Migrates V1 (flat) settings directly to the latest version (V3).
|
||||
* This includes both structural migration (flat -> nested) and boolean
|
||||
* inversion (disable* -> enable*), so migrateV2ToV3 will be skipped.
|
||||
*/
|
||||
function migrateV1ToLatest(
|
||||
flatSettings: Record<string, unknown>,
|
||||
): Record<string, unknown> | null {
|
||||
if (!needsMigration(flatSettings)) {
|
||||
|
|
@ -943,7 +948,7 @@ export function loadSettings(
|
|||
|
||||
let settingsObject = rawSettings as Record<string, unknown>;
|
||||
if (needsMigration(settingsObject)) {
|
||||
const migratedSettings = migrateSettingsToV2(settingsObject);
|
||||
const migratedSettings = migrateV1ToLatest(settingsObject);
|
||||
if (migratedSettings) {
|
||||
if (MIGRATE_V2_OVERWRITE) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue