@mjhls/mjh-framework 1.0.771-full-path-docgroup → 1.0.771-full-path-docgroup-v2

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/cjs/View.js CHANGED
@@ -91,31 +91,15 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
91
91
  if (!docGroup) {
92
92
  return null;
93
93
  }
94
- var url = void 0;
95
-
96
- if (docGroup.path && docGroup.path.includes('/') && (!docGroup.parent || !docGroup.parent.parent)) {
97
- return '/' + docGroup.path;
98
- }
99
- // Checking if Parent has Parent
100
- if (docGroup.path && docGroup.path.includes('/') && docGroup.parent && docGroup.parent.parent) {
101
- if (docGroup.path.includes(docGroup.parent.identifier.current)) {
102
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.path;
103
- } else {
104
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
105
- }
106
- }
107
-
108
- if (docGroup.parent) {
109
- url = '/' + docGroup.parent.identifier.current;
110
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
111
- url = '/' + docGroup.parent.parent.identifier.current + url;
94
+ var url = docGroup.path;
95
+ var parent = docGroup.parent || false;
96
+ while (parent) {
97
+ if (!url.includes(parent.identifier.current)) {
98
+ url = parent.identifier.current + '/' + url;
112
99
  }
100
+ parent = parent.parent ? parent.parent : false;
113
101
  }
114
-
115
- if (!docGroup.thumbnail) ;
116
- url = url + '/' + docGroup.path;
117
-
118
- return url;
102
+ return '/' + url;
119
103
  };
120
104
 
121
105
  var getDocumentGroupName = function getDocumentGroupName(docGroup) {
package/dist/esm/View.js CHANGED
@@ -81,31 +81,15 @@ var getDocumentGroupUrl = function getDocumentGroupUrl(docGroup) {
81
81
  if (!docGroup) {
82
82
  return null;
83
83
  }
84
- var url = void 0;
85
-
86
- if (docGroup.path && docGroup.path.includes('/') && (!docGroup.parent || !docGroup.parent.parent)) {
87
- return '/' + docGroup.path;
88
- }
89
- // Checking if Parent has Parent
90
- if (docGroup.path && docGroup.path.includes('/') && docGroup.parent && docGroup.parent.parent) {
91
- if (docGroup.path.includes(docGroup.parent.identifier.current)) {
92
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.path;
93
- } else {
94
- return '/' + docGroup.parent.parent.identifier.current + '/' + docGroup.parent.identifier.current + '/' + docGroup.path;
95
- }
96
- }
97
-
98
- if (docGroup.parent) {
99
- url = '/' + docGroup.parent.identifier.current;
100
- if (docGroup.parent.parent && docGroup.parent.parent.name) {
101
- url = '/' + docGroup.parent.parent.identifier.current + url;
84
+ var url = docGroup.path;
85
+ var parent = docGroup.parent || false;
86
+ while (parent) {
87
+ if (!url.includes(parent.identifier.current)) {
88
+ url = parent.identifier.current + '/' + url;
102
89
  }
90
+ parent = parent.parent ? parent.parent : false;
103
91
  }
104
-
105
- if (!docGroup.thumbnail) ;
106
- url = url + '/' + docGroup.path;
107
-
108
- return url;
92
+ return '/' + url;
109
93
  };
110
94
 
111
95
  var getDocumentGroupName = function getDocumentGroupName(docGroup) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.771-full-path-docgroup",
3
+ "version": "1.0.771-full-path-docgroup-v2",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",