Skip to content

Commit

Permalink
pref: code refactor refs #58 (thx @loganfsmyth)
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Jul 2, 2018
1 parent 89e9dfe commit 125687d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ module.exports = ({template, types}) => {
let pluginOptions
const ExportsDefaultVisitor = {
AssignmentExpression (path) {
// Not `object.anything`, skip
if (!path.get('left.object').node) {
return
}

const name = `${path.get('left.object.name').node}.${path.get(`left.property.name`).node}`
if (name === 'exports.default') {
if (path.get('left').matchesPattern('exports.default')) {
const finder = new ExportsFinder(path)
if (!finder.isOnlyExportsDefault()) {
return
Expand Down

0 comments on commit 125687d

Please sign in to comment.