"use strict";var e=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),t=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(n){if(n&&n.__esModule)return n;var i={};if(null!=n)for(var r in n)"default"!==r&&Object.prototype.hasOwnProperty.call(n,r)&&e(i,n,r);return t(i,n),i},i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,a){function o(e){try{s(i.next(e))}catch(e){a(e)}}function c(e){try{s(i.throw(e))}catch(e){a(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,c)}s((i=i.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.updatePackageJson=void 0;const a=r(require("path")),o=require("../../common/Constants"),c=require("../../util"),s=n(require("lodash")),u=require("../../util/FsUtil"),d=require("../parameter");exports.updatePackageJson=function(e,t){return i(this,void 0,void 0,(function*(){const n=a.default.join(e,o.Constants.MyPackageJson);let i={};if((yield u.FsUtil.exists(n))&&(i=yield u.FsUtil.readJSON5(n)),yield d.ParameterizationManager.getInstance().isParameter(i))return;const r=void 0===i.dependencies?{}:i.dependencies,l=void 0===i.devDependencies?{}:i.devDependencies,f=void 0===i.dynamicDependencies?{}:i.dynamicDependencies;s.isEqual(r,t.dependencies)&&s.isEqual(l,t.devDependencies)&&s.isEqual(f,t.dynamicDependencies)||(Object.keys(t).forEach((e=>{i[e]=t[e]})),c.FsBlockingUtil.writeFileSync(n,JSON.stringify(i,null,2)))}))};