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

tree-visit

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-visit - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

20

lib/__tests__/index.js
"use strict";
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -428,5 +439,10 @@ const access_1 = require("../access");

var _a;
const { find, access, visit, reduce, flatMap, map } = (0, withOptions_1.withOptions)({
const _b = (0, withOptions_1.withOptions)({
getChildren,
});
}), { find, access, visit, reduce, flatMap, map } = _b, Tree = __rest(_b, ["find", "access", "visit", "reduce", "flatMap", "map"]);
expect(Tree.getChildren(example, []).map((node) => node.name)).toEqual([
'b',
'c',
]);
expect(Tree.getChildren(example.children[0], []).map((node) => node.name)).toEqual(['b1', 'b2']);
let enterNames = [];

@@ -433,0 +449,0 @@ visit(example, {

@@ -15,2 +15,8 @@ import { DiagramOptions } from './diagram';

/**
* Returns the node's children.
*
* This is the same as the `getChildren` option passed to `withOptions`, included here for convenience.
*/
getChildren: BaseOptions<T>['getChildren'];
/**
* Returns a node by its `IndexPath`.

@@ -17,0 +23,0 @@ *

@@ -17,2 +17,3 @@ "use strict";

return {
getChildren: baseOptions.getChildren,
access: (node, indexPath) => (0, access_1.access)(node, indexPath, baseOptions),

@@ -19,0 +20,0 @@ accessPath: (node, indexPath) => (0, access_1.accessPath)(node, indexPath, baseOptions),

2

package.json
{
"name": "tree-visit",
"version": "0.2.0",
"version": "0.2.1",
"description": "A tree traversal library.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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