Socket
Socket
Sign inDemoInstall

rc-tree

Package Overview
Dependencies
Maintainers
2
Versions
306
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree - npm Package Compare versions

Comparing version 0.19.0 to 0.19.1

27

lib/Tree.js

@@ -120,3 +120,6 @@ 'use strict';

var newChildren = item.props.children;
if (Array.isArray(newChildren)) {
if (newChildren) {
if (!Array.isArray(newChildren)) {
newChildren = [newChildren];
}
loop(newChildren, pos);

@@ -136,5 +139,17 @@ }

}
var splitPos = function splitPos(pos) {
return pos.split('-');
};
// stripTail('x-xx-sss-xx')
var stripTail = function stripTail(str) {
var arr = str.match(/(.+)(-[^-]+)$/);
var st = '';
if (arr && arr.length === 3) {
st = arr[1];
}
return st;
};
checkedArr.forEach(function (_pos) {
Object.keys(obj).forEach(function (i) {
if (i.length > _pos.length && i.indexOf(_pos) === 0) {
if (splitPos(i).length > splitPos(_pos).length && i.indexOf(_pos) === 0) {
obj[i].checkPart = false;

@@ -153,4 +168,4 @@ if (evt) {

var loop = function loop(__pos) {
var _posLen = __pos.length;
if (_posLen <= 3) {
var _posLen = splitPos(__pos).length;
if (_posLen <= 2) {
return;

@@ -160,5 +175,5 @@ }

var siblingChecked = 0;
var parentPos = __pos.substring(0, _posLen - 2);
var parentPos = stripTail(__pos);
Object.keys(obj).forEach(function (i) {
if (i.length === _posLen && i.substring(0, _posLen - 2) === parentPos) {
if (splitPos(i).length === _posLen && i.indexOf(parentPos) === 0) {
sibling++;

@@ -165,0 +180,0 @@ if (obj[i].checked) {

{
"name": "rc-tree",
"version": "0.19.0",
"version": "0.19.1",
"description": "tree ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

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