UNPKG

estree-to-babel

Version:
12 lines (8 loc) 313 B
export const convertTSParenthesizedType = ({convertParens}) => (path) => { if (!convertParens) return; const {typeAnnotation} = path.node; typeAnnotation.extra = typeAnnotation.extra || {}; typeAnnotation.extra.parenthesized = true; path.replaceWith(typeAnnotation); };