catchup-library-web 1.2.16 → 1.2.17

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.
package/dist/index.d.mts CHANGED
@@ -470,7 +470,7 @@ declare const retrieveCategoryVersionCodeOptionList: () => {
470
470
  declare const filterCategoryVersionCodeOptionList: (categoryVersionCodeOptionList: any, coterieType: string, level: any) => any;
471
471
  declare const filterCategoryVersionCodeOptionListByGradeDTO: (categoryVersionCodeOptionList: any, coterieType: string, gradeDTO: any) => any;
472
472
  declare const filterCategoryVersionCodeOptionListByInstitutionDTO: (categoryVersionCodeOptionList: any, coterieType: string, institutionDTO: any) => any;
473
- declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any;
473
+ declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any[];
474
474
 
475
475
  declare const ONE_HOUR = 3600000;
476
476
  declare const ONE_DAY = 86400000;
package/dist/index.d.ts CHANGED
@@ -470,7 +470,7 @@ declare const retrieveCategoryVersionCodeOptionList: () => {
470
470
  declare const filterCategoryVersionCodeOptionList: (categoryVersionCodeOptionList: any, coterieType: string, level: any) => any;
471
471
  declare const filterCategoryVersionCodeOptionListByGradeDTO: (categoryVersionCodeOptionList: any, coterieType: string, gradeDTO: any) => any;
472
472
  declare const filterCategoryVersionCodeOptionListByInstitutionDTO: (categoryVersionCodeOptionList: any, coterieType: string, institutionDTO: any) => any;
473
- declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any;
473
+ declare const constructCategoryTreeFromParentCode: (categorySet: any[]) => any[];
474
474
 
475
475
  declare const ONE_HOUR = 3600000;
476
476
  declare const ONE_DAY = 86400000;
package/dist/index.js CHANGED
@@ -8080,7 +8080,16 @@ var constructCategoryTreeFromParentCode = (categorySet) => {
8080
8080
  rootNodes.push(node);
8081
8081
  }
8082
8082
  });
8083
- return rootNodes;
8083
+ const sortNodesByCode = (nodes) => {
8084
+ nodes.sort((a, b) => a.code.localeCompare(b.code));
8085
+ nodes.forEach((node) => {
8086
+ if (node.subCategoryDTOList && node.subCategoryDTOList.length > 0) {
8087
+ sortNodesByCode(node.subCategoryDTOList);
8088
+ }
8089
+ });
8090
+ return nodes;
8091
+ };
8092
+ return sortNodesByCode(rootNodes);
8084
8093
  };
8085
8094
 
8086
8095
  // src/utilization/DateUtilization.ts
package/dist/index.mjs CHANGED
@@ -7894,7 +7894,16 @@ var constructCategoryTreeFromParentCode = (categorySet) => {
7894
7894
  rootNodes.push(node);
7895
7895
  }
7896
7896
  });
7897
- return rootNodes;
7897
+ const sortNodesByCode = (nodes) => {
7898
+ nodes.sort((a, b) => a.code.localeCompare(b.code));
7899
+ nodes.forEach((node) => {
7900
+ if (node.subCategoryDTOList && node.subCategoryDTOList.length > 0) {
7901
+ sortNodesByCode(node.subCategoryDTOList);
7902
+ }
7903
+ });
7904
+ return nodes;
7905
+ };
7906
+ return sortNodesByCode(rootNodes);
7898
7907
  };
7899
7908
 
7900
7909
  // src/utilization/DateUtilization.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -336,5 +336,21 @@ export const constructCategoryTreeFromParentCode = (categorySet: any[]) => {
336
336
  }
337
337
  });
338
338
 
339
- return rootNodes;
339
+ // Sort function that can be applied recursively
340
+ const sortNodesByCode = (nodes: any[]) => {
341
+ // Sort the current level
342
+ nodes.sort((a, b) => a.code.localeCompare(b.code));
343
+
344
+ // Sort each node's children
345
+ nodes.forEach((node) => {
346
+ if (node.subCategoryDTOList && node.subCategoryDTOList.length > 0) {
347
+ sortNodesByCode(node.subCategoryDTOList);
348
+ }
349
+ });
350
+
351
+ return nodes;
352
+ };
353
+
354
+ // Apply sorting to the root nodes and all descendants
355
+ return sortNodesByCode(rootNodes);
340
356
  };