theprogrammablemind_4wp 9.5.1-beta.0 → 9.5.1-beta.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +35 -1
package/package.json CHANGED
@@ -71,6 +71,6 @@
71
71
  "sort-json": "^2.0.0",
72
72
  "uuid": "^8.3.2"
73
73
  },
74
- "version": "9.5.1-beta.0",
74
+ "version": "9.5.1-beta.2",
75
75
  "license": "UNLICENSED"
76
76
  }
package/src/config.js CHANGED
@@ -1898,6 +1898,13 @@ class Config {
1898
1898
  return
1899
1899
  }
1900
1900
 
1901
+ const idToScope = {}
1902
+ for (const bridge in config.bridges) {
1903
+ if (bridge.scope) {
1904
+ idToScope[bridge.id] = scope
1905
+ }
1906
+ }
1907
+
1901
1908
  const keep = (element) => {
1902
1909
  const old_result = element.scope !== 'testing'
1903
1910
  let new_result = false
@@ -1908,6 +1915,7 @@ class Config {
1908
1915
  }
1909
1916
  if (global.GORDO && old_result !== new_result) {
1910
1917
  global.GORDO = false
1918
+ console.log("THERE WAS A DIFFERENCE ------------------------------------------------")
1911
1919
  debugger // greg23old
1912
1920
  }
1913
1921
  return old_result
@@ -1917,7 +1925,33 @@ class Config {
1917
1925
  config.bridges = config.bridges.filter((element) => keep(element))
1918
1926
  config.generators = config.generators.filter((element) => keep(element))
1919
1927
  config.semantics = config.semantics.filter((element) => keep(element))
1920
- config.hierarchy = (config.hierarchy).filter((element) => keep(element))
1928
+
1929
+ // account for element missing correct scope
1930
+ config.hierarchy = (config.hierarchy).filter((element) => {
1931
+ if (!keep(element)) {
1932
+ return false
1933
+ }
1934
+ const discard = (id) => {
1935
+ if (idToScope[id]) {
1936
+ return !keep({ scope: idToScope[id] })
1937
+ }
1938
+ }
1939
+ if (element.child && discard(element.child)) {
1940
+ return false
1941
+ }
1942
+ if (element.parent && discard(element.parent)) {
1943
+ return false
1944
+ }
1945
+ if (Array.isArray(element)) {
1946
+ if (discard(element[0])) {
1947
+ return false
1948
+ }
1949
+ if (discard(element[1])) {
1950
+ return false
1951
+ }
1952
+ }
1953
+ return true
1954
+ })
1921
1955
 
1922
1956
  const literals = config.words.literals
1923
1957
  for (const word in literals) {