theprogrammablemind 7.5.8-beta.45 → 7.5.8-beta.46

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
@@ -60,7 +60,6 @@ const vimdiff = (actualJSON, expectedJSON) => {
60
60
  // console.log(`vimdiff ${path}/actual.json ${path}/expected.json`)
61
61
  {
62
62
  const editor = runtime.process.env.EDITOR || 'vimdiff'
63
- debugger
64
63
  // const child = runtime.child_process.spawn(editor, [`${path}/expected.json`, `${path}/actual.json`], { stdio: 'inherit' })
65
64
  console.log(`${editor} ${path}/expected.json ${path}/actual.json`)
66
65
  runtime.child_process.execSync(`${editor} ${path}/expected.json ${path}/actual.json`, {stdio: 'inherit'})
@@ -1493,7 +1492,7 @@ const knowledgeModule = async ({
1493
1492
  if (!isProcess) {
1494
1493
  if (template) {
1495
1494
  if (config.needsRebuild(template.template, template.instance)) {
1496
- throw new Error(`This module "${config.name}" cannot be used because the instance file needs rebuilding. Run on the command line with no arguements or the -rt argument to rebuild.`)
1495
+ throw new Error(`This module "${config.name}" cannot be used because the instance file needs rebuilding. Run on the command line with no arguments or the -rt argument to rebuild.`)
1497
1496
  }
1498
1497
  try {
1499
1498
  config.load(template.template, template.instance)
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.45",
66
+ "version": "7.5.8-beta.46",
67
67
  "license": "ISC"
68
68
  }
package/src/config.js CHANGED
@@ -70,16 +70,7 @@ 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
-
74
- // const apis = (name) => config.getConfig(name).api
75
- const apis = (name) => {
76
- try {
77
- return config.getConfig(name).api
78
- } catch( e ) {
79
- debugger
80
- debugger
81
- }
82
- }
73
+ const apis = (name) => config.getConfig(name).api
83
74
 
84
75
  return {
85
76
  ...args,
@@ -949,7 +940,10 @@ class Config {
949
940
  return { ...query, where: undefined }
950
941
  }
951
942
  }
952
- const sameQueries = helpers.safeEquals((cleanupWhere(template.queries) || []).map(helpers.updateQueries), (cleanupWhere(instance.queries) || []))
943
+ const cleanupWheres = (elements) => {
944
+ return elements.map( cleanupWhere )
945
+ }
946
+ const sameQueries = helpers.safeEquals(cleanupWheres(template.queries || []).map(helpers.updateQueries), cleanupWheres(instance.queries || []))
953
947
  return !(instance && sameQueries && sameFragments)
954
948
  }
955
949
 
package/src/helpers.js CHANGED
@@ -53,6 +53,8 @@ const safeEquals = (v1, v2) => {
53
53
  return v1 == v2
54
54
  } else if (type == 'function') {
55
55
  return v1.toString() == v2.toString()
56
+ } else if (v1 == undefined || v2 == undefined) {
57
+ return v1 == v2
56
58
  } else {
57
59
  if (v1.length != v2.length) {
58
60
  return false