@mu-cabin/opms-permission 0.8.28 → 0.8.29
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.cjs +4 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -207,11 +207,13 @@ function findFirstEnableNode(data) {
|
|
207
207
|
function handleOrgTreeByPermission(data) {
|
208
208
|
const orgNoAuthMap = {};
|
209
209
|
function processNode(node) {
|
210
|
+
const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
|
210
211
|
if (node.disabled) {
|
211
212
|
orgNoAuthMap[node.orgId] = node;
|
212
|
-
|
213
|
+
if (!processedChildren?.length) {
|
214
|
+
return null;
|
215
|
+
}
|
213
216
|
}
|
214
|
-
const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
|
215
217
|
return {
|
216
218
|
...node,
|
217
219
|
children: processedChildren || []
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
@@ -168,11 +168,13 @@ function findFirstEnableNode(data) {
|
|
168
168
|
function handleOrgTreeByPermission(data) {
|
169
169
|
const orgNoAuthMap = {};
|
170
170
|
function processNode(node) {
|
171
|
+
const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
|
171
172
|
if (node.disabled) {
|
172
173
|
orgNoAuthMap[node.orgId] = node;
|
173
|
-
|
174
|
+
if (!processedChildren?.length) {
|
175
|
+
return null;
|
176
|
+
}
|
174
177
|
}
|
175
|
-
const processedChildren = node.children?.map((child) => processNode(child)).filter((child) => child !== null);
|
176
178
|
return {
|
177
179
|
...node,
|
178
180
|
children: processedChildren || []
|