UNPKG

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