mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
af0b0a9ab1
swc_ecma_transforms: - fixer: Don't unwrap paren if there's a comment for inner node.
9 lines
361 B
JavaScript
9 lines
361 B
JavaScript
function isModuleWrapper(node) {
|
|
return (
|
|
// It's an anonymous function expression that wraps module
|
|
(node.type === 'FunctionExpression' && !node.id) ||
|
|
node.type === 'ArrowFunctionExpression' ||
|
|
isModuleId(node) ||
|
|
(node.type === 'ArrayExpression' && node.elements.length > 1 && isModuleId(node.elements[0]))
|
|
)
|
|
} |