theprogrammablemind 7.3.11 → 7.3.12
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/package.json +1 -1
- package/src/config.js +17 -11
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -61,12 +61,12 @@ const hierarchyToCanonical = (edge) => {
|
|
61
61
|
return edge
|
62
62
|
}
|
63
63
|
|
64
|
-
const addWord = (
|
65
|
-
if (!
|
66
|
-
|
64
|
+
const addWord = (config, uuid) => ({ word, id, initial }) => {
|
65
|
+
if (!config.words) {
|
66
|
+
config.words = {}
|
67
67
|
}
|
68
|
-
const words =
|
69
|
-
const def = { id, initial, uuid
|
68
|
+
const words = config.words
|
69
|
+
const def = { id, initial, uuid }
|
70
70
|
if (words[word]) {
|
71
71
|
if (!words[word].some((e) => helpers.safeEquals(e, def))) {
|
72
72
|
words[word].unshift(def)
|
@@ -1395,7 +1395,8 @@ class Config {
|
|
1395
1395
|
const objects = {}
|
1396
1396
|
const km = (name) => this.getConfig(name)
|
1397
1397
|
if (config instanceof Config) {
|
1398
|
-
const aw = addWord(this, config)
|
1398
|
+
// const aw = addWord(this.config, config.uuid)
|
1399
|
+
const aw = (word, def) => this.addWord(word, def)
|
1399
1400
|
this.get('objects').namespaced[config._uuid] = objects
|
1400
1401
|
if (config._api) {
|
1401
1402
|
config._api.objects = objects
|
@@ -1403,7 +1404,8 @@ class Config {
|
|
1403
1404
|
}
|
1404
1405
|
config.initializerFn({ addWord: aw, km, config, baseConfig: this, currentConfig: config, objects, namespace, uuid, api: config.api })
|
1405
1406
|
} else {
|
1406
|
-
const aw = addWord(this, this)
|
1407
|
+
// const aw = addWord(this.config, this.uuid)
|
1408
|
+
const aw = (word, def) => this.addWord(word, def)
|
1407
1409
|
this.get('objects').namespaced[this._uuid] = objects
|
1408
1410
|
if (config._api) {
|
1409
1411
|
config._api.objects = objects
|
@@ -1417,7 +1419,8 @@ class Config {
|
|
1417
1419
|
|
1418
1420
|
initialize ({ force = true } = {}) {
|
1419
1421
|
if (force || !this.wasInitialized) {
|
1420
|
-
const aw = addWord(this, this)
|
1422
|
+
// const aw = addWord(this.config, this.uuid)
|
1423
|
+
const aw = (word, def) => this.addWord(word, def)
|
1421
1424
|
const km = (name) => this.getConfig(name)
|
1422
1425
|
// this.initializerFn({ addWord: aw, km, config: this, baseConfig: this, currentConfig: this, objects: this.get('objects'), uuid: this._uuid, namespace: '', api: this.api })
|
1423
1426
|
const objects = this.config.objects.namespaced[this._uuid]
|
@@ -1624,7 +1627,8 @@ class Config {
|
|
1624
1627
|
this.config.objects.namespaced[km._uuid] = {}
|
1625
1628
|
const namespacedObjects = this.config.objects.namespaced[km._uuid]
|
1626
1629
|
this.setupNamespace(km)
|
1627
|
-
const aw = addWord(km.config, km.config)
|
1630
|
+
// const aw = addWord(km.config.config ? km.config.config : km.config, km.config.uuid)
|
1631
|
+
const aw = (word, def) => this.addWord(word, def)
|
1628
1632
|
let config = km.config
|
1629
1633
|
|
1630
1634
|
if (config.addedArgss) {
|
@@ -1791,10 +1795,12 @@ class Config {
|
|
1791
1795
|
}
|
1792
1796
|
const km = (name) => this.getConfig(name)
|
1793
1797
|
if (config instanceof Config) {
|
1794
|
-
const aw = addWord(this, config)
|
1798
|
+
// const aw = addWord(this.config, config.uuid)
|
1799
|
+
const aw = (word, def) => this.addWord(word, def)
|
1795
1800
|
config.initializerFn({ isModule: this.isModule, addWord: aw, baseConfig: this, km, currentConfig: config, config, objects: nsobjects, namespace, uuid, api: config.api })
|
1796
1801
|
} else {
|
1797
|
-
const aw = addWord(this, this)
|
1802
|
+
// const aw = addWord(this.config, this.uuid)
|
1803
|
+
const aw = (word, def) => this.addWord(word, def)
|
1798
1804
|
this.initializerFn({ isModule: this.isModule, addWord: aw, baseConfig: this, km, currentConfig: this, config: this, objects: nsobjects, namespace, uuid, api: this.api })
|
1799
1805
|
}
|
1800
1806
|
})
|