mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-02 01:11:24 -07:00
refactor(cli): fix settings merging so that settings using the new json format take priority over ones using the old format (#15116)
This commit is contained in:
@@ -28,11 +28,16 @@ function mergeRecursively(
|
||||
path: string[] = [],
|
||||
) {
|
||||
for (const key of Object.keys(source)) {
|
||||
if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
|
||||
// JSON.parse can create objects with __proto__ as an own property.
|
||||
// We must skip it to prevent prototype pollution.
|
||||
if (key === '__proto__') {
|
||||
continue;
|
||||
}
|
||||
const srcValue = source[key];
|
||||
if (srcValue === undefined) {
|
||||
continue;
|
||||
}
|
||||
const newPath = [...path, key];
|
||||
const srcValue = source[key];
|
||||
const objValue = target[key];
|
||||
const mergeStrategy = getMergeStrategyForPath(newPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user