(chore) rename function
This commit is contained in:
parent
75ee2bdfda
commit
ab2b78eaec
@ -2,7 +2,7 @@ import { tsquery } from '@phenomnomnominal/tsquery';
|
||||
|
||||
import { ParserInterface } from './parser.interface';
|
||||
import { TranslationCollection } from '../utils/translation.collection';
|
||||
import { findClasses, findClassPropertyByType, findMethodCallExpression, getStringsFromExpression } from '../utils/ast-helpers';
|
||||
import { findClasses, findClassPropertyByType, findMethodCallExpressions, getStringsFromExpression } from '../utils/ast-helpers';
|
||||
|
||||
const TRANSLATE_SERVICE_TYPE_REFERENCE = 'TranslateService';
|
||||
const TRANSLATE_SERVICE_METHOD_NAMES = ['get', 'instant', 'stream'];
|
||||
@ -25,7 +25,7 @@ export class ServiceParser implements ParserInterface {
|
||||
return;
|
||||
}
|
||||
|
||||
const callNodes = findMethodCallExpression(classNode, propName, TRANSLATE_SERVICE_METHOD_NAMES);
|
||||
const callNodes = findMethodCallExpressions(classNode, propName, TRANSLATE_SERVICE_METHOD_NAMES);
|
||||
callNodes.forEach(callNode => {
|
||||
const [firstArgNode] = callNode.arguments;
|
||||
if (!firstArgNode) {
|
||||
|
@ -72,7 +72,7 @@ export function findFunctionCallExpressions(node: Node, fnName: string | string[
|
||||
return nodes;
|
||||
}
|
||||
|
||||
export function findMethodCallExpression(node: Node, prop: string, fnName: string | string[]): CallExpression[] {
|
||||
export function findMethodCallExpressions(node: Node, prop: string, fnName: string | string[]): CallExpression[] {
|
||||
if (Array.isArray(fnName)) {
|
||||
fnName = fnName.join('|');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user