콘텐츠로 이동
한국어

deepMerge

이 콘텐츠는 아직 번역되지 않았습니다.

deepMerge(base, overlay): ConfigObject

Defined in: src/config/HoconParser.ts:525

Deep merge — values in overlay win, objects merge recursively, arrays overwrite.

Both sides are filtered through isForbiddenConfigKey. The parser already refuses those keys, so for HOCON input this is redundant — but deepMerge is exported and merges layers that come from plain JavaScript objects too, where JSON.parse('{"__proto__":{…}}') yields an own __proto__ property that Object.entries happily reports. Note the base is copied key by key rather than with { ...base }: a spread would carry such an own property straight through.

ConfigObject

ConfigObject

ConfigObject