Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unist-util-visit

Package Overview
Dependencies
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unist-util-visit - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

24

index.d.ts

@@ -17,9 +17,3 @@ export const visit: (<T extends import('unist').Node>(

tree: Node,
test:
| null
| undefined
| Type
| Props
| TestFunctionAnything
| Array<Type | Props | TestFunctionAnything>,
test: Test,
visitor: Visitor<Node>,

@@ -31,8 +25,4 @@ reverse?: boolean

export type Parent = import('unist').Parent
export type Type = import('unist-util-is').Type
export type Props = import('unist-util-is').Props
export type TestFunctionAnything = import('unist-util-is').TestFunctionAnything
export type Action = import('unist-util-visit-parents').Action
export type Index = import('unist-util-visit-parents').Index
export type ActionTuple = import('unist-util-visit-parents').ActionTuple
export type Test = import('unist-util-is').Test
export type VisitorResult = import('unist-util-visit-parents').VisitorResult
/**

@@ -53,9 +43,3 @@ * Invoked when a node (matching test, if given) is found.

parent: Parent | null
) =>
| null
| undefined
| Action
| Index
| import('unist-util-visit-parents').ActionTuple
| void
) => VisitorResult
import {CONTINUE} from 'unist-util-visit-parents'

@@ -62,0 +46,0 @@ import {SKIP} from 'unist-util-visit-parents'

14

index.js
/**
* @typedef {import('unist').Node} Node
* @typedef {import('unist').Parent} Parent
* @typedef {import('unist-util-is').Type} Type
* @typedef {import('unist-util-is').Props} Props
* @typedef {import('unist-util-is').TestFunctionAnything} TestFunctionAnything
* @typedef {import('unist-util-visit-parents').Action} Action
* @typedef {import('unist-util-visit-parents').Index} Index
* @typedef {import('unist-util-visit-parents').ActionTuple} ActionTuple
* @typedef {import('unist-util-is').Test} Test
* @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult
*/

@@ -28,3 +24,3 @@

* @param {Parent|null} parent Parent of `node`
* @returns {null|undefined|Action|Index|ActionTuple|void}
* @returns {VisitorResult}
*/

@@ -40,3 +36,3 @@

* (<T extends Node>(tree: Node, test: T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>|Array.<T['type']|Partial<T>|import('unist-util-is').TestFunctionPredicate<T>>, visitor: Visitor<T>, reverse?: boolean) => void) &
* ((tree: Node, test: null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>, visitor: Visitor<Node>, reverse?: boolean) => void) &
* ((tree: Node, test: Test, visitor: Visitor<Node>, reverse?: boolean) => void) &
* ((tree: Node, visitor: Visitor<Node>, reverse?: boolean) => void)

@@ -50,3 +46,3 @@ * )}

* @param {Node} tree Abstract syntax tree to walk
* @param {null|undefined|Type|Props|TestFunctionAnything|Array<Type|Props|TestFunctionAnything>} test test Test node
* @param {Test} test test Test node
* @param {Visitor<Node>} visitor Function to run for each node

@@ -53,0 +49,0 @@ * @param {boolean} [reverse] Fisit the tree in reverse, defaults to false

{
"name": "unist-util-visit",
"version": "3.0.1",
"version": "3.1.0",
"description": "unist utility to visit nodes",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc