unist-util-remove
Advanced tools
Comparing version 1.0.2 to 1.0.3
'use strict' | ||
var is = require('unist-util-is') | ||
var convert = require('unist-util-is/convert') | ||
@@ -8,2 +8,3 @@ module.exports = remove | ||
function remove(ast, opts, test) { | ||
var is | ||
var cascade | ||
@@ -18,2 +19,3 @@ | ||
cascade = cascade === null || cascade === undefined ? true : cascade | ||
is = convert(test) | ||
@@ -31,3 +33,3 @@ return preorder(ast, null, null) | ||
if (is(test, node, nodeIndex, parent)) { | ||
if (is(node, nodeIndex, parent)) { | ||
return null | ||
@@ -34,0 +36,0 @@ } |
{ | ||
"name": "unist-util-remove", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Remove nodes from Unist tree", | ||
@@ -30,3 +30,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"unist-util-is": "^2.0.0" | ||
"unist-util-is": "^3.0.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
@@ -7,2 +7,5 @@ # unist-util-remove | ||
[![Size][size-badge]][size] | ||
[![Sponsors][sponsors-badge]][collective] | ||
[![Backers][backers-badge]][collective] | ||
[![Chat][chat-badge]][chat] | ||
@@ -128,2 +131,12 @@ [**unist**][unist] utility to modify the given tree by removing all nodes that | ||
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg | ||
[backers-badge]: https://opencollective.com/unified/backers/badge.svg | ||
[collective]: https://opencollective.com/unified | ||
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg | ||
[chat]: https://spectrum.chat/unified/syntax-tree | ||
[npm]: https://docs.npmjs.com/cli/install | ||
@@ -130,0 +143,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8283
48
163
+ Addedunist-util-is@3.0.0(transitive)
- Removedunist-util-is@2.1.3(transitive)
Updatedunist-util-is@^3.0.0