fix return type
This commit is contained in:
parent
4fe3c43624
commit
75ee2bdfda
@ -9,7 +9,7 @@ const MARKER_PACKAGE_IMPORT_NAME = 'marker';
|
|||||||
|
|
||||||
export class MarkerParser implements ParserInterface {
|
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 sourceFile = tsquery.ast(contents, filePath);
|
||||||
|
|
||||||
const markerFnName = getNamedImportAlias(sourceFile, MARKER_PACKAGE_MODULE_NAME, MARKER_PACKAGE_IMPORT_NAME);
|
const markerFnName = getNamedImportAlias(sourceFile, MARKER_PACKAGE_MODULE_NAME, MARKER_PACKAGE_IMPORT_NAME);
|
||||||
|
@ -2,6 +2,6 @@ import { TranslationCollection } from '../utils/translation.collection';
|
|||||||
|
|
||||||
export interface ParserInterface {
|
export interface ParserInterface {
|
||||||
|
|
||||||
extract(template: string, path: string): TranslationCollection;
|
extract(source: string, filePath: string): TranslationCollection | null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream'];
|
|||||||
|
|
||||||
export class ServiceParser implements ParserInterface {
|
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 sourceFile = tsquery.ast(source, filePath);
|
||||||
|
|
||||||
const classNodes = findClasses(sourceFile);
|
const classNodes = findClasses(sourceFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user