refactor: 去掉 replaceAllKeys 无人使用的返回值

两处调用点都是裸语句、忽略返回值,函数保持原地修改语义,调用方行为不变。
连带删掉专门断言返回值的那个用例,其余测试不变。
This commit is contained in:
文睿 张 2026-09-21 15:34:45 +08:00
parent 72bc6c9af2
commit 102c75079d
2 changed files with 0 additions and 7 deletions

View File

@ -10,5 +10,4 @@
export function replaceAllKeys(target, values) {
Object.keys(target).forEach(key => { delete target[key] })
Object.assign(target, values)
return target
}

View File

@ -42,10 +42,4 @@ describe('replaceAllKeys', () => {
expect(form.code).toBe('B')
expect(form.status).toBe('active')
})
test('返回 target,便于链式书写', () => {
const form = {}
expect(replaceAllKeys(form, { code: 'A' })).toBe(form)
})
})