remarkjs / strip-markdown
Showing 1 of 5 files from the diff.
Other files ignored by Codecov
package.json has changed.
test.js has changed.
types/index.d.ts has changed.
types/test.ts has changed.

@@ -38,18 +38,34 @@
Loading
38 38
var own = {}.hasOwnProperty
39 39
40 40
function strip(options) {
41 -
  var keep = (options || {}).keep || []
41 +
  var handlers = {}
42 42
  var map = {}
43 +
  var settings = options || {}
44 +
  var remove = settings.remove || []
45 +
  var keep = settings.keep || []
43 46
  var length = keep.length
44 47
  var index = -1
45 48
  var key
46 49
50 +
  if (remove.length === 0) {
51 +
    handlers = defaults
52 +
  } else {
53 +
    handlers = Object.assign({}, defaults)
54 +
    remove.forEach((name) => {
55 +
      if (Array.isArray(name)) {
56 +
        handlers[name[0]] = name[1]
57 +
      } else {
58 +
        handlers[name] = empty
59 +
      }
60 +
    })
61 +
  }
62 +
47 63
  if (length === 0) {
48 -
    map = defaults
64 +
    map = handlers
49 65
  } else {
50 -
    for (key in defaults) {
66 +
    for (key in handlers) {
51 67
      if (keep.indexOf(key) === -1) {
52 -
        map[key] = defaults[key]
68 +
        map[key] = handlers[key]
53 69
      }
54 70
    }
55 71
@@ -57,7 +73,7 @@
Loading
57 73
    while (++index < length) {
58 74
      key = keep[index]
59 75
60 -
      if (!own.call(defaults, key)) {
76 +
      if (!own.call(handlers, key)) {
61 77
        throw new Error(
62 78
          'Invalid `keep` option: No modifier is defined for node type `' +
63 79
            key +
Files Coverage
index.js 100.00%
Project Totals (1 files) 100.00%
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