{"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/remove-upgrader.ts"],"names":[],"mappings":"AAIA,qBAAa,cAAc;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAM;IAErB,OAAO,CAAC,QAAQ,CAEd;IAEF;;;;;OAKG;gBACS,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM;IAO7D;;OAEG;IACU,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiBpC","file":"remove-upgrader.d.ts","sourcesContent":["import { pathExists } from 'fs-extra';\r\nimport { Logger } from '../utils/logger';\r\nimport { FileWriter } from '../utils/file-writer';\r\n\r\nexport class RemoveUpgrader {\r\n    private filePath: string;\r\n    private fileWriter: FileWriter;\r\n    private removes: any;\r\n\r\n    private messages = {\r\n        notFound: ''\r\n    };\r\n\r\n    /**\r\n     * the constructor.\r\n     * @param filePath the file path.\r\n     * @param removes the removes.\r\n     * @param fileName the file name.\r\n     */\r\n    constructor(filePath: string, removes: any, fileName?: string) {\r\n        this.filePath = filePath;\r\n        this.messages.notFound = `${fileName} not found at ${this.filePath}.`\r\n\r\n        this.removes = removes;\r\n    }\r\n\r\n    /**\r\n     * the run function to resolve the errors.\r\n     */\r\n    public async run(): Promise<void> {\r\n        try {\r\n            const exists = await pathExists(this.filePath);\r\n\r\n            if (exists) {\r\n                this.fileWriter = new FileWriter(this.filePath);\r\n\r\n                this.fileWriter\r\n                    .removeContent(this.removes)\r\n                    .writeFile();\r\n            } else {\r\n                    Logger.log(this.messages.notFound);\r\n            }\r\n        } catch (error) {\r\n            Logger.error(error);\r\n        }\r\n    }\r\n}\r\n"]}