@01-edu/shared 1.1.2 → 1.1.3
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/attrs.js +4 -0
- package/package.json +1 -1
package/attrs.js
CHANGED
|
@@ -349,6 +349,8 @@ const expandAttr = (key, value, defs, object, getUser) => {
|
|
|
349
349
|
// by providing a filter function
|
|
350
350
|
export const partialExpandDynamicAttrs = (object, getUser, filterFn) => {
|
|
351
351
|
if (!object.children) return (object.children = {})
|
|
352
|
+
if (!Object.keys(object.children).length) return
|
|
353
|
+
|
|
352
354
|
const defautlAttrs = getDefaultAttrsEntries(object)
|
|
353
355
|
const filteredDefaultAttrs = defautlAttrs.filter(filterFn)
|
|
354
356
|
|
|
@@ -382,6 +384,8 @@ export const partialExpandDynamicAttrs = (object, getUser, filterFn) => {
|
|
|
382
384
|
// so the result can be recalculated as needed
|
|
383
385
|
export const expandDynamicAttrs = (object, getUser) => {
|
|
384
386
|
if (!object.children) return (object.children = {})
|
|
387
|
+
if (!Object.keys(object.children).length) return
|
|
388
|
+
|
|
385
389
|
const defautlAttrs = getDefaultAttrsEntries(object)
|
|
386
390
|
|
|
387
391
|
processAttributes(defautlAttrs, object, getUser)
|