@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.
Files changed (2) hide show
  1. package/attrs.js +4 -0
  2. 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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@01-edu/shared",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "scripts": {