mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-01 21:20:44 +00:00
Rename to migrateV1ToV3
This commit is contained in:
parent
273caf1cde
commit
efb1eb37a2
1 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue