theprogrammablemind_4wp 9.6.3-beta.1 → 9.6.3-beta.10
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/package.json +1 -1
- package/src/project.js +6 -0
- package/src/project2.js +6 -0
package/package.json
CHANGED
package/src/project.js
CHANGED
|
@@ -23,6 +23,12 @@ const project = (object, filter) => {
|
|
|
23
23
|
return object
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
if (object.checks) {
|
|
27
|
+
for (const check in object.checks) {
|
|
28
|
+
filter.push(check)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
const projection = {}
|
|
27
33
|
const set = (property, value) => {
|
|
28
34
|
if (value === null || value === undefined) {
|
package/src/project2.js
CHANGED
|
@@ -16,6 +16,7 @@ function project(source, filters, path=[]) {
|
|
|
16
16
|
if (['boolean', 'string', 'number'].includes(typeof source)) {
|
|
17
17
|
return source
|
|
18
18
|
}
|
|
19
|
+
|
|
19
20
|
if (Array.isArray(source)) {
|
|
20
21
|
const result = []
|
|
21
22
|
for (const value of source) {
|
|
@@ -45,6 +46,11 @@ function project(source, filters, path=[]) {
|
|
|
45
46
|
|
|
46
47
|
// Get the properties to include from the apply function
|
|
47
48
|
let properties = filter.apply(source);
|
|
49
|
+
if (source?.checks) {
|
|
50
|
+
for (const check of source.checks) {
|
|
51
|
+
properties.push(check)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
48
54
|
|
|
49
55
|
// update
|
|
50
56
|
const updatedProperties = []
|