UNPKG

@marxian/react-scripts

Version:

Configuration and scripts for Create React App.

17 lines (12 loc) 376 B
import { getProp, getLiteralPropValue } from 'jsx-ast-utils'; /** * Returns the implicit role for a menu tag. */ export default function getImplicitRoleForMenu(attributes) { const type = getProp(attributes, 'type'); if (type) { const value = getLiteralPropValue(type); return (value && value.toUpperCase() === 'TOOLBAR') ? 'toolbar' : ''; } return ''; }