theprogrammablemind 7.5.8-beta.71 → 7.5.8-beta.73

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/client.js CHANGED
@@ -1157,10 +1157,16 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
1157
1157
  }
1158
1158
  const picked = pickEm()
1159
1159
  if (!_.isEmpty(picked)) {
1160
- console.log('--- checked object properties ---')
1160
+ console.log('--- Object showing only the checked values ---')
1161
1161
  console.log(JSON.stringify(picked, null, 2))
1162
1162
  }
1163
1163
 
1164
+ const pickedResultContexts = responses.contexts.map(pickContext(config.testConfig))
1165
+ if (pickedResultContexts.some( (context) => Object.keys(context).length > 0 )) {
1166
+ console.log('--- Contexts showing only the checked values ---')
1167
+ console.log(JSON.stringify(pickedResultContexts, null, 2))
1168
+ }
1169
+
1164
1170
  console.log('--- The contexts are ----------')
1165
1171
  console.log(JSON.stringify(sortJson(responses.contexts, { depth: 25 }), null, 2))
1166
1172
  console.log('')
package/package.json CHANGED
@@ -64,6 +64,6 @@
64
64
  "json-stable-stringify": "^1.0.1",
65
65
  "node-fetch": "^2.6.1"
66
66
  },
67
- "version": "7.5.8-beta.71",
67
+ "version": "7.5.8-beta.73",
68
68
  "license": "ISC"
69
69
  }
package/src/helpers.js CHANGED
@@ -172,9 +172,6 @@ const isCompound = (value) => {
172
172
  return isArray(value) || isObject(value)
173
173
  }
174
174
 
175
- nextCallId = 0
176
- nextContextId = 0
177
-
178
175
  class InitCalls {
179
176
 
180
177
  constructor(name) {
@@ -198,9 +195,10 @@ class InitCalls {
198
195
  // this.nextCallId += 1
199
196
  // this.stack.push(this.nextCallId)
200
197
  this.stack.push(this.nextCallId)
198
+ // TODO put the nextContextId in the context for debugging
201
199
  const calls = this.stack.map( (call) => `${this.name}#call${call}` )
202
200
  // return `Context#${this.nextContextId}: ${calls}`
203
- return `Context#${nextContextId}: ${calls}`
201
+ return `Context#${this.nextContextId}: ${calls}`
204
202
  }
205
203
 
206
204
  current() {
package/src/project.js CHANGED
@@ -11,13 +11,30 @@ const project = (object, filter) => {
11
11
  } else {
12
12
  for (let properties of filter) {
13
13
  if (typeof properties == 'object') {
14
- debugger
15
- const subfilterProperty = Object.keys(properties)[0]
16
- oldValue = object[subfilterProperty]
17
- if (Array.isArray(oldValue)) {
18
- projection[subfilterProperty] = oldValue.map((v) => project(v, properties[subfilterProperty]))
19
- } else {
20
- projection[subfilterProperty] = project(oldValue, properties[subfilterProperty])
14
+ if (properties.propertyLists) {
15
+ for (const propertyList in properties.propertyLists) {
16
+ if (object[propertyList]) {
17
+ for (const property of object[propertyList]) {
18
+ projection[property] = project(object[property], properties.propertyLists[propertyList])
19
+ }
20
+ }
21
+ }
22
+ }
23
+ if (properties.valueLists) {
24
+ for (const listProperty in properties.valueLists) {
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
+ }
31
+ }
32
+ }
33
+ if (properties.properties) {
34
+ for (const property in properties.properties) {
35
+ const old = object[property]
36
+ projection[property] = project(old, properties.properties[property])
37
+ }
21
38
  }
22
39
  } else {
23
40
  if (!Array.isArray(properties)) {