UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

1 lines 1.53 kB
{"version":3,"sources":["../../../packages/tools/wac-cli/src/angular15/upgrader/audit/css-syntax-error-updater.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAGnE;;GAEG;AACH,qBAAa,qBAAqB;IAC9B;;;;;OAKG;IACI,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM;IAW3D;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAIrB","file":"css-syntax-error-updater.d.ts","sourcesContent":["import { ResolveState } from '../../../common';\r\nimport { ErrorResult } from '../../../upgrade/models/error-result';\r\nimport { Logger } from '../../utils/logger';\r\n\r\n/**\r\n * Updater for css-syntax-error warning.\r\n */\r\nexport class CssSyntaxErrorUpdater {\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): string {\r\n if (!fileData) {\r\n Logger.error(`Cannot find file data`);\r\n }\r\n\r\n const result = this.regexFixer(fileData);\r\n\r\n error.resolved = ResolveState.Resolved;\r\n return result;\r\n }\r\n\r\n /**\r\n * the update function.\r\n * @param inputString the input file data string.\r\n * @returns the updated file data string.\r\n */\r\n private regexFixer(inputString): string {\r\n inputString = inputString.replace(/:host\\s*>>>\\s*\\./g, ':host::ng-deep .');\r\n return inputString.replace(/:host\\s*>>>\\s*/g, ':host::');\r\n }\r\n}\r\n"]}