Skip to content

Commit

Permalink
fix: make condition more specific
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Jan 31, 2023
1 parent bad9c01 commit 0885bc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rollup/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ export default (args: Record<string, string>): rollup.RollupOptions[] => {
}
} else if (node.callee.type === 'Identifier' && PURE_FUNCTIONS.has(node.callee.name)) {
path.replace(addComment(node))
} else if (node.callee.type === 'FunctionExpression') {
// Mark IIFE as pure, because typescript compile enums as IIFE
} else if (node.callee.type === 'FunctionExpression' && node.arguments.length === 1) {
// Mark IIFE with single parameter as pure, because typescript compile enums as IIFE
path.replace(addComment(node))
}
this.traverse(path)
Expand Down Expand Up @@ -360,8 +360,8 @@ export default (args: Record<string, string>): rollup.RollupOptions[] => {
}
} else if (node.callee.type === 'Identifier' && PURE_FUNCTIONS.has(node.callee.name)) {
path.replace(addComment(node))
} else if (node.callee.type === 'FunctionExpression') {
// Mark IIFE as pure, because typescript compile enums as IIFE
} else if (node.callee.type === 'FunctionExpression' && node.arguments.length === 1) {
// Mark IIFE with single parameter as pure, because typescript compile enums as IIFE
path.replace(addComment(node))
}
this.traverse(path)
Expand Down

0 comments on commit 0885bc2

Please sign in to comment.