ekms 9.6.3-beta.13 → 9.6.3-beta.14

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/common/stm.js CHANGED
@@ -80,7 +80,7 @@ class API {
80
80
  helpers.unshiftL(frameOfReference.mentioned, concept, this.maximumMentioned)
81
81
  }
82
82
 
83
- recall({ context, frameOfReference, useHierarchy=true, all, condition = (() => true), filter = ((result) => result) } = {}) {
83
+ recall({ context, frameOfReference, useHierarchy=true, all, stopCondition = (() => false), condition = (() => true), filter = ((result) => result) } = {}) {
84
84
  let mentioned = this._objects.mentioned
85
85
  let reversed = false
86
86
  if (frameOfReference) {
@@ -116,6 +116,9 @@ class API {
116
116
  // care about value first
117
117
  let findCounter = 0
118
118
  for (const m of mentioned) {
119
+ if (stopCondition(m)) {
120
+ break
121
+ }
119
122
  if (context.value && (context.value == m.marker || context.value == m.value)) {
120
123
  findCounter += 1
121
124
  if (findPrevious && findCounter < 2) {
@@ -145,6 +148,9 @@ class API {
145
148
  // care about marker second
146
149
  findCounter = 0
147
150
  for (const m of mentioned) {
151
+ if (stopCondition(m)) {
152
+ break
153
+ }
148
154
  if (context.marker != 'unknown' && this.isA(m.marker, context.marker)) {
149
155
  findCounter += 1
150
156
  if (findPrevious && findCounter < 2) {
@@ -164,6 +170,9 @@ class API {
164
170
  // if (context.types && context.types.includes(m.marker)) {
165
171
  if (context.types) {
166
172
  for (const parent of context.types) {
173
+ if (stopCondition(m)) {
174
+ break
175
+ }
167
176
  if (parent != 'unknown' && this.isA(m.marker, parent)) {
168
177
  findCounter += 1
169
178
  if (findPrevious && findCounter < 2) {
@@ -196,6 +205,9 @@ class API {
196
205
  if (findPrevious && findCounter < 2) {
197
206
  continue
198
207
  }
208
+ if (stopCondition(m)) {
209
+ break
210
+ }
199
211
  if (condition(m)) {
200
212
  if (all) {
201
213
  addForAll(m)
package/package.json CHANGED
@@ -386,8 +386,8 @@
386
386
  "scriptjs": "^2.5.9",
387
387
  "table": "^6.7.1",
388
388
  "uuid": "^9.0.0",
389
- "theprogrammablemind": "9.6.3-beta.13"
389
+ "theprogrammablemind": "9.6.3-beta.14"
390
390
  },
391
- "version": "9.6.3-beta.13",
391
+ "version": "9.6.3-beta.14",
392
392
  "license": "UNLICENSED"
393
393
  }