fix return type
This commit is contained in:
		| @@ -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); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user