UNPKG

@vendure/ngx-translate-extract

Version:
15 lines (14 loc) 382 B
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(); }