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

rc-tree-select

Package Overview
Dependencies
Maintainers
2
Versions
264
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tree-select - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

37

lib/util.js

@@ -188,13 +188,24 @@ 'use strict';

// console.log(filterParentPosition(['0-2', '0-10', '0-0-1', '0-1-1', '0-0','0-1', '0-10-0']));
function containsPath(path1, path2) {
if (path2.length > path1.length) {
return false;
}
for (var i = 0; i < path2.length; i++) {
if (path1[i] !== path2[i]) {
return false;
}
}
return true;
}
var stripTail = function stripTail(str) {
var arr = str.match(/(.+)(-[^-]+)$/);
var st = '';
if (arr && arr.length === 3) {
st = arr[1];
}
return st;
};
function handleCheckState(obj, checkedPosArr, checkIt) {
var stripTail = function stripTail(str) {
var arr = str.match(/(.+)(-[^-]+)$/);
var st = '';
if (arr && arr.length === 3) {
st = arr[1];
}
return st;
};
// stripTail('x-xx-sss-xx')

@@ -205,5 +216,7 @@ var splitPos = function splitPos(pos) {

checkedPosArr.forEach(function (_pos) {
var posPath = splitPos(_pos);
// 设置子节点,全选或全不选
Object.keys(obj).forEach(function (i) {
if (splitPos(i).length > splitPos(_pos).length && i.indexOf(_pos) === 0) {
var iPath = splitPos(i);
if (iPath.length > posPath.length && containsPath(iPath, posPath)) {
obj[i].checkPart = false;

@@ -223,4 +236,6 @@ obj[i].checked = checkIt;

var parentPos = stripTail(__pos);
var parentPosPath = splitPos(parentPos);
Object.keys(obj).forEach(function (i) {
if (splitPos(i).length === _posLen && i.indexOf(parentPos) === 0) {
var iPath = splitPos(i);
if (iPath.length === _posLen && containsPath(iPath, parentPosPath)) {
sibling++;

@@ -227,0 +242,0 @@ if (obj[i].checked) {

{
"name": "rc-tree-select",
"version": "1.2.2",
"version": "1.2.3",
"description": "tree-select 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