Skip to content

Commit 420d9b7

Browse files
committed
Update unist-util-is
1 parent cf286bb commit 420d9b7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use strict'
22

3-
var is = require('unist-util-is')
3+
var convert = require('unist-util-is/convert')
44

55
module.exports = findAllBefore
66

77
function findAllBefore(parent, index, test) {
8+
var is = convert(test)
89
var results = []
910
var children
1011
var child
@@ -31,7 +32,7 @@ function findAllBefore(parent, index, test) {
3132
while (index--) {
3233
child = children[index]
3334

34-
if (is(test, child, index, parent)) {
35+
if (is(child, index, parent)) {
3536
results.push(child)
3637
}
3738
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
1919
],
2020
"dependencies": {
21-
"unist-util-is": "^2.0.0"
21+
"unist-util-is": "^3.0.0"
2222
},
2323
"devDependencies": {
2424
"browserify": "^16.0.0",

0 commit comments

Comments
 (0)