github.com/jfrog/frogbot@v1.1.1-0.20231221090046-821a26f50338/action/node_modules/@octokit/endpoint/dist-src/util/merge-deep.js (about) 1 import { isPlainObject } from "is-plain-object"; 2 export function mergeDeep(defaults, options) { 3 const result = Object.assign({}, defaults); 4 Object.keys(options).forEach((key) => { 5 if (isPlainObject(options[key])) { 6 if (!(key in defaults)) 7 Object.assign(result, { [key]: options[key] }); 8 else 9 result[key] = mergeDeep(defaults[key], options[key]); 10 } 11 else { 12 Object.assign(result, { [key]: options[key] }); 13 } 14 }); 15 return result; 16 }