Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
selectedMenu = getNodeByPropertyAndValue(menuTreeData, 'path', path, (itemValue, value, item) => {
const isTop = item.children && item.children.length;
const re = pathToRegexp(itemValue);
return !!re.exec(value) && !isTop; // 排除父级节点
});
}