theprogrammablemind_4wp 7.11.1 → 7.12.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/client.js +14 -5
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -1843,8 +1843,9 @@ const knowledgeModuleImpl = async ({
1843
1843
  if (results.length > 0) {
1844
1844
  let headerShown = false
1845
1845
 
1846
- let hasError = false
1846
+ let errorCount = 0
1847
1847
  for (const result of results) {
1848
+ let hasError = false
1848
1849
  if (JSON.stringify(result.expected.paraphrases) !== JSON.stringify(result.actual.paraphrases)) {
1849
1850
  hasError = true
1850
1851
  }
@@ -1865,8 +1866,11 @@ const knowledgeModuleImpl = async ({
1865
1866
  if (!sameJSON(result.expected.checkedContexts, result.actual.checkedContexts)) {
1866
1867
  hasError = true
1867
1868
  }
1869
+ if (hasError) {
1870
+ errorCount += 1
1871
+ }
1868
1872
  }
1869
-
1873
+ const hasError = errorCount > 0
1870
1874
  if (hasError) {
1871
1875
  console.log('**************************** ERRORS ************************')
1872
1876
  for (const result of results) {
@@ -1883,6 +1887,7 @@ const knowledgeModuleImpl = async ({
1883
1887
  if (args.vimdiff) {
1884
1888
  vimdiff(result.actual.paraphrasesParenthesized, result.expected.paraphrasesParenthesized)
1885
1889
  }
1890
+ errorCount += 1
1886
1891
  }
1887
1892
  }
1888
1893
  show('paraphrases', result.expected.paraphrases, result.actual.paraphrases)
@@ -1967,7 +1972,7 @@ const knowledgeModuleImpl = async ({
1967
1972
  if (!(useTestConfig.check && useTestConfig.check.length > 0)) {
1968
1973
  console.log('use -v arg to write files expected.json and actual.json in the current directory for detailed comparison. Or do -s and then git diff the changes.')
1969
1974
  // console.log(JSON.stringify(contexts))
1970
- console.log('**************************** THERE WERE ERRORS ************************')
1975
+ console.log(`**************************** THERE WERE ${errorCount} ERRORS ************************`)
1971
1976
  }
1972
1977
  }
1973
1978
  }
@@ -2068,10 +2073,14 @@ const knowledgeModuleImpl = async ({
2068
2073
  }
2069
2074
 
2070
2075
  createConfigExport = () => {
2076
+ if (createConfig.cached) {
2077
+ return createConfig.cached
2078
+ }
2071
2079
  const config = createConfig()
2072
2080
  initConfig(config)
2073
- config.rebuild({ isModule: true })
2074
- return config
2081
+ // config.rebuild({ isModule: true })
2082
+ createConfig.cached = config
2083
+ return createConfig.cached
2075
2084
  }
2076
2085
  moduleFromJSFile.exports = createConfigExport
2077
2086
  }
package/package.json CHANGED
@@ -65,6 +65,6 @@
65
65
  "json-stable-stringify": "^1.0.1",
66
66
  "node-fetch": "^2.6.1"
67
67
  },
68
- "version": "7.11.1",
68
+ "version": "7.12.0-beta.0",
69
69
  "license": "UNLICENSED"
70
70
  }