import{readFile,writeFile}from"node:fs/promises";async function patchPackageJson(e,t){let n=await readFile(e,`utf8`),r=JSON.parse(n);t.dependencies!==void 0&&(r.dependencies={...r.dependencies,...t.dependencies}),t.devDependencies!==void 0&&(r.devDependencies={...r.devDependencies,...t.devDependencies}),t.scripts!==void 0&&(r.scripts={...r.scripts,...t.scripts}),await writeFile(e,`${JSON.stringify(r,null,2)}\n`,`utf8`)}export{patchPackageJson};