@coasys/ad4m 0.10.0-rc7 → 0.10.0-rc7.fix.3
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/lib/index.cjs
CHANGED
|
@@ -4900,7 +4900,14 @@ class PerspectiveProxy {
|
|
|
4900
4900
|
*/
|
|
4901
4901
|
async isSubjectInstance(expression, subjectClass) {
|
|
4902
4902
|
let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
|
|
4903
|
-
|
|
4903
|
+
let isInstance = false;
|
|
4904
|
+
const maxAttempts = 5;
|
|
4905
|
+
let attempts = 0;
|
|
4906
|
+
while (attempts < maxAttempts && !isInstance) {
|
|
4907
|
+
isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
|
|
4908
|
+
attempts++;
|
|
4909
|
+
}
|
|
4910
|
+
return isInstance;
|
|
4904
4911
|
}
|
|
4905
4912
|
/** For an existing subject instance (existing in the perspective's links)
|
|
4906
4913
|
* this function returns a proxy object that can be used to access the subject's
|
package/lib/index.js
CHANGED
|
@@ -4896,7 +4896,14 @@ class PerspectiveProxy {
|
|
|
4896
4896
|
*/
|
|
4897
4897
|
async isSubjectInstance(expression, subjectClass) {
|
|
4898
4898
|
let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
|
|
4899
|
-
|
|
4899
|
+
let isInstance = false;
|
|
4900
|
+
const maxAttempts = 5;
|
|
4901
|
+
let attempts = 0;
|
|
4902
|
+
while (attempts < maxAttempts && !isInstance) {
|
|
4903
|
+
isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
|
|
4904
|
+
attempts++;
|
|
4905
|
+
}
|
|
4906
|
+
return isInstance;
|
|
4900
4907
|
}
|
|
4901
4908
|
/** For an existing subject instance (existing in the perspective's links)
|
|
4902
4909
|
* this function returns a proxy object that can be used to access the subject's
|
|
@@ -307,7 +307,14 @@ export class PerspectiveProxy {
|
|
|
307
307
|
*/
|
|
308
308
|
async isSubjectInstance(expression, subjectClass) {
|
|
309
309
|
let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass);
|
|
310
|
-
|
|
310
|
+
let isInstance = false;
|
|
311
|
+
const maxAttempts = 5;
|
|
312
|
+
let attempts = 0;
|
|
313
|
+
while (attempts < maxAttempts && !isInstance) {
|
|
314
|
+
isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
|
|
315
|
+
attempts++;
|
|
316
|
+
}
|
|
317
|
+
return isInstance;
|
|
311
318
|
}
|
|
312
319
|
/** For an existing subject instance (existing in the perspective's links)
|
|
313
320
|
* this function returns a proxy object that can be used to access the subject's
|
package/package.json
CHANGED
|
@@ -365,7 +365,16 @@ export class PerspectiveProxy {
|
|
|
365
365
|
*/
|
|
366
366
|
async isSubjectInstance<T>(expression: string, subjectClass: T): Promise<boolean> {
|
|
367
367
|
let className = await this.stringOrTemplateObjectToSubjectClass(subjectClass)
|
|
368
|
-
|
|
368
|
+
let isInstance = false;
|
|
369
|
+
const maxAttempts = 5;
|
|
370
|
+
let attempts = 0;
|
|
371
|
+
|
|
372
|
+
while (attempts < maxAttempts && !isInstance) {
|
|
373
|
+
isInstance = await this.infer(`subject_class("${className}", C), instance(C, "${expression}")`);
|
|
374
|
+
attempts++;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
return isInstance
|
|
369
378
|
}
|
|
370
379
|
|
|
371
380
|
|