syntax-tree / hast-util-find-and-replace
Showing 1 of 3 files from the diff.
Other files ignored by Codecov
package.json has changed.
readme.md has changed.

@@ -1,7 +1,7 @@
Loading
1 1
'use strict'
2 2
3 3
var visit = require('unist-util-visit-parents')
4 -
var is = require('hast-util-is-element')
4 +
var convert = require('hast-util-is-element/convert')
5 5
var escape = require('escape-string-regexp')
6 6
7 7
var defaultIgnore = ['title', 'script', 'style', 'svg', 'math']
@@ -117,7 +117,7 @@
Loading
117 117
}
118 118
119 119
function search(tree, options, handler) {
120 -
  var ignore = options.ignore || defaultIgnore
120 +
  var ignored = convert(options.ignore || defaultIgnore)
121 121
  var result = []
122 122
123 123
  visit(tree, 'text', visitor)
@@ -126,15 +126,27 @@
Loading
126 126
127 127
  function visitor(node, parents) {
128 128
    var length = parents.length
129 -
    var index = length
129 +
    var index = -1
130 +
    var parent
131 +
    var grandparent
130 132
131 -
    while (index--) {
132 -
      if (is(parents[index], ignore)) {
133 +
    while (++index < length) {
134 +
      parent = parents[index]
135 +
136 +
      if (
137 +
        ignored(
138 +
          parent,
139 +
          grandparent ? grandparent.children.indexOf(parent) : undefined,
140 +
          grandparent
141 +
        )
142 +
      ) {
133 143
        return
134 144
      }
145 +
146 +
      grandparent = parent
135 147
    }
136 148
137 -
    handler(node, parents[length - 1])
149 +
    handler(node, grandparent)
138 150
  }
139 151
}
140 152
Files Coverage
index.js 100.00%
Project Totals (1 files) 100.00%
30.1
lts/dubnium=/dubnium
TRAVIS_OS_NAME=linux
30.2
node=
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading