function cleanPackageJSON() { const content = fs.readFileSync(pkgPath, "utf8") process.once("exit", () => fs.outputFileSync(pkgPath, content)) const pkgJSON = JSON.parse(content) for (const field of fieldsToRemove) { Reflect.deleteProperty(pkgJSON, field) } pkgJSON.scripts = defaultScripts fs.outputFileSync(pkgPath, fleece.patch(content, pkgJSON)) }
function cleanPackageJSON() { const content = fs.readFileSync(pkgPath, "utf8") process.once("exit", () => fs.outputFileSync(pkgPath, content)) const pkgJSON = JSON.parse(content) fieldsToRemove.forEach((field) => Reflect.deleteProperty(pkgJSON, field)) pkgJSON.scripts = defaultScripts fs.outputFileSync(pkgPath, fleece.patch(content, pkgJSON)) }