Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkomarychev committed Mar 10, 2020
1 parent ab8f8be commit 8159896
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/visit.js
@@ -1,7 +1,7 @@
exports.__esModule = true

exports.default = function __visit(node, keys, visitorSpec) {
if (!node) {
exports.default = function visit(node, keys, visitorSpec) {
if (!node || !keys) {
return
}
const type = node.type
Expand All @@ -16,10 +16,10 @@ exports.default = function __visit(node, keys, visitorSpec) {
const field = node[fieldName]
if (Array.isArray(field)) {
for (const item of field) {
__visit(item, keys, visitorSpec)
visit(item, keys, visitorSpec)
}
} else {
__visit(field, keys, visitorSpec)
visit(field, keys, visitorSpec)
}
}
if (typeof visitorSpec[`${type}:Exit`] === 'function') {
Expand Down

0 comments on commit 8159896

Please sign in to comment.