import { Node, SyntaxKind, NamedDeclaration } from 'typescript'; import { Predicate } from '@ibm-wch-sdk/utils'; export function byType(aType: SyntaxKind): Predicate { return node => node && node.kind === aType; } export function byText(aText: string): Predicate { return node => node && node.getText() === aText; } export function byName(aText: string): Predicate { return node => !!(node && node.name && node.name.getText() === aText); } export function byTypeAndName( aType: SyntaxKind, aName: string ): Predicate { return node => node && node.kind === aType && node.getText() === aName; } export function byIdentifier(aName: string): Predicate { return byTypeAndName(SyntaxKind.Identifier, aName); }