"use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.dependencyNameInconsistencyAlarm=void 0;const s=require("../../common/message"),t=e(require("path")),n=require("../../common/Constants"),o=e(require("../../log"));exports.dependencyNameInconsistencyAlarm=function(e){const r=[];return{alarmMessageRecords:r,recordInconsistencyMessage:e=>{for(const o of Object.keys(e.root.requirements)){const a=e.root.requirements[o],c=e.pickRoughNode(o,a.spec,e.root);if(o!==c.nodeData.actualName){const a=(0,s.format)(s.Messages.Fetcher.InconsistentDependencyKey,{depName:o,pkgJsonPath:t.default.join(e.moduleRootDir,n.Constants.MyPackageJson),packageName:c.nodeData.actualName});r.push(a)}}},alarmInconsistencyMessage:()=>{if(r.forEach((s=>e?o.default.error("",s):o.default.warn("",s))),e&&r.length>0)throw new Error(s.Messages.Install.InconsistentDepNames)}}};