@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
37 lines (35 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CssSyntaxErrorUpdater = void 0;
const common_1 = require("../../../common");
const logger_1 = require("../../utils/logger");
/**
* Updater for css-syntax-error warning.
*/
class CssSyntaxErrorUpdater {
/**
* the update function.
* @param fileData the file data.
* @param error the error object.
* @returns the updated file data.
*/
update(fileData, error) {
if (!fileData) {
logger_1.Logger.error(`Cannot find file data`);
}
const result = this.regexFixer(fileData);
error.resolved = common_1.ResolveState.Resolved;
return result;
}
/**
* the update function.
* @param inputString the input file data string.
* @returns the updated file data string.
*/
regexFixer(inputString) {
inputString = inputString.replace(/:host\s*>>>\s*\./g, ':host::ng-deep .');
return inputString.replace(/:host\s*>>>\s*/g, ':host::');
}
}
exports.CssSyntaxErrorUpdater = CssSyntaxErrorUpdater;
//# sourceMappingURL=css-syntax-error-updater.js.map