(refactor) rename constants

This commit is contained in:
Kim Biesbjerg 2019-09-17 14:24:01 +02:00
parent 16bf5f59e0
commit 7bf0c138b8

View File

@ -4,15 +4,15 @@ import { ParserInterface } from './parser.interface';
import { TranslationCollection } from '../utils/translation.collection';
import { getNamedImportAlias, findFunctionCallExpressions, getStringsFromExpression } from '../utils/ast-helpers';
const MARKER_PACKAGE_MODULE_NAME = '@biesbjerg/ngx-translate-extract-marker';
const MARKER_PACKAGE_IMPORT_NAME = 'marker';
const MARKER_MODULE_NAME = '@biesbjerg/ngx-translate-extract-marker';
const MARKER_IMPORT_NAME = 'marker';
export class MarkerParser implements ParserInterface {
public extract(contents: string, filePath: string): TranslationCollection | null {
const sourceFile = tsquery.ast(contents, filePath);
const markerImportName = getNamedImportAlias(sourceFile, MARKER_PACKAGE_MODULE_NAME, MARKER_PACKAGE_IMPORT_NAME);
const markerImportName = getNamedImportAlias(sourceFile, MARKER_MODULE_NAME, MARKER_IMPORT_NAME);
if (!markerImportName) {
return;
}