react-cosmos-shared2
Advanced tools
Comparing version 5.2.0-alpha.2 to 5.2.0-alpha.3
@@ -8,4 +8,2 @@ "use strict"; | ||
var _lodash = require("lodash"); | ||
function hideSingleChildDirs(rootNode) { | ||
@@ -20,15 +18,5 @@ var items = rootNode.items, | ||
var newDirs = {}; | ||
(0, _lodash.forEach)(dirs, function (dir, dirName) { | ||
var subDirNames = Object.keys(dir.dirs); | ||
if (containsSingleDir(dir) && !newDirs[subDirNames[0]]) { | ||
newDirs[subDirNames[0]] = hideSingleChildDirs(dir.dirs[subDirNames[0]]); | ||
} else { | ||
newDirs[dirName] = hideSingleChildDirs(dir); | ||
} | ||
}); | ||
return { | ||
items: items, | ||
dirs: newDirs | ||
dirs: dirs | ||
}; | ||
@@ -35,0 +23,0 @@ } |
@@ -9,13 +9,4 @@ "use strict"; | ||
function getSortedNodeDirNames(nodeDirs) { | ||
return Object.keys(nodeDirs).slice() // Sort alphabetically first | ||
.sort().sort(function (dirName1, dirName2) { | ||
return calcNodeDepth(nodeDirs[dirName2]) - calcNodeDepth(nodeDirs[dirName1]); | ||
}); | ||
} // Only differentiate between nodes with and without subdirs and ignore | ||
// depth level in the latter | ||
function calcNodeDepth(node) { | ||
var hasDirs = Object.keys(node.dirs).length > 0; | ||
return hasDirs ? 1 : 0; | ||
return Object.keys(nodeDirs).slice() // Sort alphabetically | ||
.sort(); | ||
} |
{ | ||
"name": "react-cosmos-shared2", | ||
"version": "5.2.0-alpha.2", | ||
"version": "5.2.0-alpha.3", | ||
"description": "Code shared between Cosmos packages", | ||
@@ -14,3 +14,3 @@ "repository": "https://github.com/react-cosmos/react-cosmos/tree/master/packages/react-cosmos-shared2", | ||
}, | ||
"gitHead": "9684624429776b4ee18b67902d9a8d8e19ace2f9" | ||
"gitHead": "3eb63074a13e6e94b5395c59b91d49caaf11746f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147422
3201