Skip to content

Commit

Permalink
includes -> indexof for node 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim-Mazurok committed Jun 5, 2020
1 parent 38cd8ea commit 0be9bcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ExportMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ ExportMap.parse = function (path, content, context) {
isEsModuleInteropTrue && exports.push('TSNamespaceExportDeclaration')

// This doesn't declare anything, but changes what's being exported.
if (exports.includes(n.type)) {
if (exports.indexOf(n.type) !== -1) {
const exportedName = n.expression && n.expression.name || n.id.name
const declTypes = [
'VariableDeclaration',
Expand All @@ -561,7 +561,7 @@ ExportMap.parse = function (path, content, context) {
'TSModuleDeclaration',
]
const exportedDecls = ast.body.filter(({ type, id, declarations }) =>
declTypes.includes(type) &&
declTypes.indexOf(type) !== -1 &&
(
(id && id.name === exportedName) ||
(declarations && declarations.find(d => d.id.name === exportedName))
Expand Down

0 comments on commit 0be9bcd

Please sign in to comment.