@postman-enricher/core 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,7 @@ function flattenRequests(items) {
33
33
  }
34
34
  function buildResourceHierarchy(items, excludePathParams, maxDepth) {
35
35
  const folderMap = new Map();
36
+ const topLevelFolders = new Set();
36
37
  items.forEach((item) => {
37
38
  if (!isRequest(item) || !item.request?.url)
38
39
  return;
@@ -51,6 +52,10 @@ function buildResourceHierarchy(items, excludePathParams, maxDepth) {
51
52
  if (parentFolder) {
52
53
  parentFolder.item.push(folder);
53
54
  }
55
+ else {
56
+ // This is a top-level folder
57
+ topLevelFolders.add(folderPath);
58
+ }
54
59
  }
55
60
  parentFolder = folderMap.get(folderPath);
56
61
  // Add item to deepest folder
@@ -60,7 +65,7 @@ function buildResourceHierarchy(items, excludePathParams, maxDepth) {
60
65
  });
61
66
  });
62
67
  // Return only top-level folders
63
- return Array.from(folderMap.values()).filter((folder) => !folder.name.includes('/'));
68
+ return Array.from(topLevelFolders).map((path) => folderMap.get(path));
64
69
  }
65
70
  function extractSegments(path, excludePathParams) {
66
71
  return path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-enricher/core",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Core enrichment logic for Postman Enricher",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "openapi-to-postmanv2": "^5.5.0",
19
19
  "yaml": "^2.8.1",
20
- "@postman-enricher/shared": "1.2.3"
20
+ "@postman-enricher/shared": "1.2.4"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@anolilab/semantic-release-pnpm": "^3.0.0",