Sha256: 91fde4f76f264ca9c87bb57679652ab00263dd0627bb2e92edcb4aa9a27ebdf0
Contents?: true
Size: 668 Bytes
Versions: 23
Compression:
Stored size: 668 Bytes
Contents
'use strict' module.exports = visit var visitParents = require('unist-util-visit-parents') var CONTINUE = visitParents.CONTINUE var SKIP = visitParents.SKIP var EXIT = visitParents.EXIT visit.CONTINUE = CONTINUE visit.SKIP = SKIP visit.EXIT = EXIT function visit(tree, test, visitor, reverse) { if (typeof test === 'function' && typeof visitor !== 'function') { reverse = visitor visitor = test test = null } visitParents(tree, test, overload, reverse) function overload(node, parents) { var parent = parents[parents.length - 1] var index = parent ? parent.children.indexOf(node) : null return visitor(node, index, parent) } }
Version data entries
23 entries across 23 versions & 1 rubygems