theprogrammablemind_4wp 7.5.8-beta.42 → 7.5.8-beta.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +10 -6
package/package.json CHANGED
@@ -63,6 +63,6 @@
63
63
  "json-stable-stringify": "^1.0.1",
64
64
  "node-fetch": "^2.6.1"
65
65
  },
66
- "version": "7.5.8-beta.42",
66
+ "version": "7.5.8-beta.44",
67
67
  "license": "ISC"
68
68
  }
package/src/config.js CHANGED
@@ -70,6 +70,9 @@ const setupInitializerFNArgs = (config, args) => {
70
70
  const aw = (word, def) => config.addWord(word, def, args.uuid)
71
71
  const ag = (generator) => config.addGenerator(generator, args.uuid, config.name)
72
72
  const km = (name) => config.getConfig(name)
73
+ console.log('name', name)
74
+ console.log('config.getConfig', config.getConfig)
75
+ console.log('config', config)
73
76
  const apis = (name) => config.getConfig(name).api
74
77
 
75
78
  return {
@@ -933,13 +936,14 @@ class Config {
933
936
  const instanceFragments = (instance.fragments || []).map((fragment) => fragment.key || fragment.query).map( toCanonical )
934
937
  const templateFragments = (template.fragments || []).concat(this.dynamicFragments).map( toCanonical )
935
938
  const sameFragments = helpers.safeEquals(templateFragments, instanceFragments)
936
- const sameQueries = helpers.safeEquals((template.queries || []).map(helpers.updateQueries), (instance.queries || []))
937
- if (!(instance && sameQueries && sameFragments)) {
938
- console.log("sameFragments", sameFragments)
939
- console.log("sameQueries", sameQueries)
940
- console.log("template.queries", template.queries)
941
- console.log("instance.queries", instance.queries)
939
+ const cleanupWhere = (query) => {
940
+ if (typeof query == 'string') {
941
+ return query
942
+ } else {
943
+ return { ...query, where: undefined }
944
+ }
942
945
  }
946
+ const sameQueries = helpers.safeEquals((cleanupWhere(template.queries) || []).map(helpers.updateQueries), (cleanupWhere(instance.queries) || []))
943
947
  return !(instance && sameQueries && sameFragments)
944
948
  }
945
949