@vendure/ngx-translate-extract
Version:
Extract strings from projects using ngx-translate
15 lines (14 loc) • 382 B
JavaScript
export function isPathAngularComponent(path) {
return /\.ts|js$/i.test(path);
}
export function extractComponentInlineTemplate(contents) {
const regExp = /template\s*:\s*(["'`])([\s\S]*?)\1/;
const match = regExp.exec(contents);
if (match !== null) {
return match[2];
}
return '';
}
export function stripBOM(contents) {
return contents.trim();
}