diff --git a/src/parsers/marker.parser.ts b/src/parsers/marker.parser.ts index 9ec5d32..19bd52d 100644 --- a/src/parsers/marker.parser.ts +++ b/src/parsers/marker.parser.ts @@ -9,7 +9,7 @@ const MARKER_PACKAGE_IMPORT_NAME = 'marker'; export class MarkerParser implements ParserInterface { - public extract(contents: string, filePath: string): TranslationCollection { + public extract(contents: string, filePath: string): TranslationCollection | null { const sourceFile = tsquery.ast(contents, filePath); const markerFnName = getNamedImportAlias(sourceFile, MARKER_PACKAGE_MODULE_NAME, MARKER_PACKAGE_IMPORT_NAME); diff --git a/src/parsers/parser.interface.ts b/src/parsers/parser.interface.ts index bc395d0..71b2aa0 100644 --- a/src/parsers/parser.interface.ts +++ b/src/parsers/parser.interface.ts @@ -2,6 +2,6 @@ import { TranslationCollection } from '../utils/translation.collection'; export interface ParserInterface { - extract(template: string, path: string): TranslationCollection; + extract(source: string, filePath: string): TranslationCollection | null; } diff --git a/src/parsers/service.parser.ts b/src/parsers/service.parser.ts index 9e2f06c..bd8af97 100644 --- a/src/parsers/service.parser.ts +++ b/src/parsers/service.parser.ts @@ -9,7 +9,7 @@ const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream']; export class ServiceParser implements ParserInterface { - public extract(source: string, filePath: string): TranslationCollection { + public extract(source: string, filePath: string): TranslationCollection | null { const sourceFile = tsquery.ast(source, filePath); const classNodes = findClasses(sourceFile);