unist-util-find
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,2 +0,3 @@ | ||
export default find; | ||
declare const _exports: <V extends import("unist").Node<import("unist").Data>>(tree: Node, condition: TestStr | TestObj | TestFn) => V | undefined; | ||
export = _exports; | ||
export type Node = import('unist').Node; | ||
@@ -17,15 +18,1 @@ /** | ||
export type TestFn = <V extends import("unist").Node<import("unist").Data>>(node: V) => boolean; | ||
/** | ||
* Unist node finder utility. | ||
* | ||
* @param tree | ||
* Node to search. | ||
* @param condition | ||
* Condition used to test each node. | ||
* @returns | ||
* The first node that matches condition, or undefined if no node matches. | ||
* @type {<V extends Node>(tree: Node, condition: TestStr | TestObj | TestFn) => V | undefined} | ||
*/ | ||
declare function find<V extends import("unist").Node<import("unist").Data>>(tree: import("unist").Node<import("unist").Data>, condition: string | { | ||
[x: string]: unknown; | ||
} | TestFn): V | undefined; |
@@ -18,4 +18,4 @@ /** | ||
import { visit } from 'unist-util-visit' | ||
import iteratee from 'lodash.iteratee' | ||
var visit = require('unist-util-visit') | ||
var iteratee = require('lodash.iteratee') | ||
@@ -33,3 +33,3 @@ /** | ||
*/ | ||
function find (tree, condition) { | ||
module.exports = function find (tree, condition) { | ||
if (!tree) throw new Error('unist-util-find requires a tree to search') | ||
@@ -50,3 +50,1 @@ if (!condition) throw new Error('unist-util-find requires a condition') | ||
} | ||
export default find |
{ | ||
"name": "unist-util-find", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Unist node finder utility. Useful for working with remark, rehype and retext.", | ||
@@ -14,11 +14,7 @@ "repository": "https://github.com/blahah/unist-util-find", | ||
"scripts": { | ||
"prepack": "npm run build", | ||
"test": "standard && node test.js", | ||
"build": "tsc", | ||
"prepare": "npm run build", | ||
"release": "release-it" | ||
"build": "tsc" | ||
}, | ||
"engines": { | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
"type": "module", | ||
"type": "commonjs", | ||
"keywords": [ | ||
@@ -40,5 +36,4 @@ "unist", | ||
"@types/unist": "^2.0.6", | ||
"release-it": "^15.11.0", | ||
"remark": "^14.0.1", | ||
"standard": "^16.0.4", | ||
"remark": "^13.0.0", | ||
"standard": "^8.0.0", | ||
"tape": "^5.3.1", | ||
@@ -49,4 +44,4 @@ "typescript": "^4.6.4" | ||
"lodash.iteratee": "^4.7.0", | ||
"unist-util-visit": "^4.1.0" | ||
"unist-util-visit": "^2.0.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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
6
6279
59
1
No
+ Addedunist-util-is@4.1.0(transitive)
+ Addedunist-util-visit@2.0.3(transitive)
+ Addedunist-util-visit-parents@3.1.1(transitive)
- Removedunist-util-is@5.2.1(transitive)
- Removedunist-util-visit@4.1.2(transitive)
- Removedunist-util-visit-parents@5.1.3(transitive)
Updatedunist-util-visit@^2.0.0