UNPKG

376 BPlain TextView Raw
1import * as ts from 'typescript';
2import { getJsxAttributesFromJsxElement } from '../JsxAttribute';
3
4const hrefString: string = 'href';
5
6/**
7 * @Returns the implicit role for a link tag.
8 */
9function getImplicitRoleForLink(node: ts.Node): string {
10 return getJsxAttributesFromJsxElement(node)[hrefString] ? 'link' : undefined;
11}
12
13export { getImplicitRoleForLink as link };