New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

unist-utils-core

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unist-utils-core - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

lib/visit-async.d.ts

3

Changelog.md

@@ -15,1 +15,4 @@ ## 1.0.0 / 2020/05/27

* Declaration fixes for the test module and visit module.
## 1.0.4 / 2020/06/23
* Add support for asynchronous visitors.

@@ -5,2 +5,3 @@ export * from './nodes';

export * from './visit';
export * from './visit-async';
export * from './select';

@@ -7,3 +7,4 @@ "use strict";

tslib_1.__exportStar(require("./visit"), exports);
tslib_1.__exportStar(require("./visit-async"), exports);
tslib_1.__exportStar(require("./select"), exports);
//# sourceMappingURL=index.js.map

@@ -82,2 +82,3 @@ import { Node, Parent } from './nodes';

}
export declare function vistorResultToTuple(value: any): any;
export declare function visit<T extends Node, P extends Parent>(tree: T | T[], visitor: Visitor<T, P>): any;

@@ -84,0 +85,0 @@ export declare function visit<T extends Node, P extends Parent>(tree: T | T[], visitor: Visitor<T, P>, options: boolean | VisitOptions): any;

7

lib/visit.js

@@ -16,3 +16,3 @@ "use strict";

exports.EXIT = false;
function toResult(value) {
function vistorResultToTuple(value) {
if (value !== null && typeof value === 'object' && 'length' in value)

@@ -24,2 +24,3 @@ return value;

}
exports.vistorResultToTuple = vistorResultToTuple;
/**

@@ -53,3 +54,3 @@ * Visit nodes (inclusive descendants of tree), with ancestral information. Optionally filtering nodes. Optionally in reverse, Optionally wrapping child visitation with pre/post visits.

if (!tst || is(node, index, parents[parents.length - 1] || null)) {
result = toResult(visitor(node, index, parents));
result = vistorResultToTuple(visitor(node, index, parents));
if (result[0] === exports.EXIT)

@@ -59,3 +60,3 @@ return result;

if (node.children && result[0] !== exports.SKIP) {
subResult = toResult(all(node.children, parents.concat(node)));
subResult = vistorResultToTuple(all(node.children, parents.concat(node)));
return subResult[0] === exports.EXIT ? subResult : result;

@@ -62,0 +63,0 @@ }

{
"name": "unist-utils-core",
"version": "1.0.3",
"version": "1.0.4",
"description": "A collection of commonly used (albeit enhanced) algorithms based on unist and unist-util-xxx",

@@ -34,2 +34,9 @@ "author": "Frank Stock",

},
"repository": {
"type": "git",
"url": "https://github.com/pcafstockf/unist-utils-core.git"
},
"bugs": {
"url": "https://github.com/pcafstockf/unist-utils-core/issues"
},
"dependencies": {

@@ -36,0 +43,0 @@ "tslib": "^1.13.0",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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