mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
removed unwanted check for childCount and added childCount property in trie Node
This commit is contained in:
@@ -15,6 +15,9 @@ function Node (options) {
|
||||
// stores all direct folder descendants of this node
|
||||
this.children = {};
|
||||
|
||||
// number of folders in the sub-trie of this node
|
||||
this.childCount = options ? options.childCount : 0;
|
||||
|
||||
this.requests = []; // request will always be an array of objects
|
||||
|
||||
this.addChildren = function (child, value) {
|
||||
|
||||
@@ -330,16 +330,9 @@ module.exports = {
|
||||
childCount: 0
|
||||
}));
|
||||
|
||||
/* eslint-disable max-depth */
|
||||
// We have to keep the count of folders under a current node as childCount
|
||||
// For ex- In case of /pets/a/b, pets has 2 childCount (i.e a & b)
|
||||
if (!currentNode.childCount) {
|
||||
currentNode.childCount = 1;
|
||||
}
|
||||
else {
|
||||
currentNode.childCount += 1;
|
||||
}
|
||||
/* eslint-enable */
|
||||
currentNode.childCount += 1;
|
||||
}
|
||||
// requestCount increment for the node we just added
|
||||
currentNode.children[currentPath[i]].requestCount += currentPathRequestCount;
|
||||
|
||||
Reference in New Issue
Block a user