ngx-matomo-client
Version:
Matomo (fka. Piwik) client for Angular applications
18 lines • 773 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.readIntoSourceFile = readIntoSourceFile;
exports.escapeLiteral = escapeLiteral;
const schematics_1 = require("@angular-devkit/schematics");
const ts = require("typescript");
function readIntoSourceFile(host, modulePath) {
const text = host.read(modulePath);
if (text === null) {
throw new schematics_1.SchematicsException(`File ${modulePath} does not exist.`);
}
const sourceText = text.toString('utf-8');
return ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
}
function escapeLiteral(str) {
return str.replace(new RegExp('\\\\', 'g'), '\\\\').replace(new RegExp(`'`, 'g'), "\\'");
}
//# sourceMappingURL=schematics-utils.js.map