fix return type

This commit is contained in:
Kim Biesbjerg 2019-09-16 16:49:47 +02:00
parent 4fe3c43624
commit 75ee2bdfda
3 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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);