{"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/audit/parameter-count-violation-updater.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAKnE;;GAEG;AACH,qBAAa,8BAA+B,YAAW,OAAO;IAC1D;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;CAsBvE","file":"parameter-count-violation-updater.d.ts","sourcesContent":["import { ResolveState } from '../../../common';\r\nimport { Updater } from '../../../upgrade/models/updater-interface';\r\nimport { ErrorResult } from '../../../upgrade/models/error-result';\r\nimport { Logger } from '../../utils/logger';\r\nimport { IiFUpdaterUtil } from './iif-updater-util';\r\nimport { SubjectNextUpdaterUtil } from './subjuct-next-updater-util';\r\n\r\n/**\r\n * the ParameterCountViolationUpdater error handler/updater.\r\n */\r\nexport class ParameterCountViolationUpdater implements Updater {\r\n    /**\r\n     * the update function.\r\n     * @param fileData the file data.\r\n     * @param error the error object.\r\n     * @returns the updated file data.\r\n     */\r\n    public update(fileData: string, error: ErrorResult): Promise<string> {\r\n        if (!fileData) {\r\n            Logger.error(`Cannot find file data`);\r\n        }\r\n        const errorLineContent = fileData.split('\\n')[error.position.line - 1];\r\n\r\n        let result = fileData;\r\n        Logger.log('line content: ' + errorLineContent);\r\n\r\n        if (errorLineContent.includes('iif')) {\r\n            const updater = new IiFUpdaterUtil();\r\n            result = updater.update(fileData, error);\r\n        } else if (errorLineContent.includes('next')) {\r\n            const updater = new SubjectNextUpdaterUtil();\r\n            result = updater.update(fileData, error);\r\n        } else {\r\n            Logger.log('Found no updater for this error: ' + JSON.stringify(error));\r\n        }\r\n\r\n        error.resolved = ResolveState.Resolved;\r\n        return new Promise(resolve => resolve(result));\r\n    }\r\n}\r\n"]}