UNPKG

estree-to-babel

Version:
14 lines (9 loc) 330 B
'use strict'; module.exports.convertTSParenthesizedType = ({convertParens}) => (path) => { if (!convertParens) return; const {typeAnnotation} = path.node; typeAnnotation.extra = typeAnnotation.extra || {}; typeAnnotation.extra.parenthesized = true; path.replaceWith(typeAnnotation); };