theprogrammablemind_4wp 7.5.8-beta.72 → 7.5.8-beta.74
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/project.js +10 -4
package/package.json
CHANGED
package/src/project.js
CHANGED
@@ -13,15 +13,21 @@ const project = (object, filter) => {
|
|
13
13
|
if (typeof properties == 'object') {
|
14
14
|
if (properties.propertyLists) {
|
15
15
|
for (const propertyList in properties.propertyLists) {
|
16
|
-
|
17
|
-
|
16
|
+
if (object[propertyList]) {
|
17
|
+
for (const property of object[propertyList]) {
|
18
|
+
projection[property] = project(object[property], properties.propertyLists[propertyList])
|
19
|
+
}
|
18
20
|
}
|
19
21
|
}
|
20
22
|
}
|
21
23
|
if (properties.valueLists) {
|
22
24
|
for (const listProperty in properties.valueLists) {
|
23
|
-
const
|
24
|
-
|
25
|
+
const old = object[listProperty]
|
26
|
+
if (Array.isArray(old)) {
|
27
|
+
projection[listProperty] = old.map((element) => project(element, properties.valueLists[listProperty]))
|
28
|
+
} else {
|
29
|
+
projection[listProperty] = project(old, properties.valueLists[listProperty])
|
30
|
+
}
|
25
31
|
}
|
26
32
|
}
|
27
33
|
if (properties.properties) {
|