theprogrammablemind_4wp 8.3.0-beta.1 → 8.3.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/configHelpers.js +23 -8
package/package.json
CHANGED
package/src/configHelpers.js
CHANGED
@@ -40,17 +40,32 @@ const asList = (context) => {
|
|
40
40
|
}
|
41
41
|
}
|
42
42
|
|
43
|
-
const isA = (hierarchy) => (child, parent) => {
|
43
|
+
const isA = (hierarchy) => (child, parent, { extended=false } = {}) => {
|
44
44
|
if (!child || !parent) {
|
45
45
|
return false
|
46
46
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
47
|
+
|
48
|
+
if (extended) {
|
49
|
+
if (hierarchy.isA(child.marker || child, parent.marker || parent)) {
|
50
|
+
return true
|
51
|
+
}
|
52
|
+
for (const childT of child.types || [child]) {
|
53
|
+
for (const parentT of parent.types || [parent]) {
|
54
|
+
if (hierarchy.isA(childT, parentT)) {
|
55
|
+
return true
|
56
|
+
}
|
57
|
+
}
|
58
|
+
}
|
59
|
+
return false
|
60
|
+
} else {
|
61
|
+
if (child.marker) {
|
62
|
+
child = child.marker
|
63
|
+
}
|
64
|
+
if (parent.marker) {
|
65
|
+
parent = parent.marker
|
66
|
+
}
|
67
|
+
return hierarchy.isA(child, parent)
|
52
68
|
}
|
53
|
-
return hierarchy.isA(child, parent)
|
54
69
|
}
|
55
70
|
|
56
71
|
class ErrorReason extends Error {
|
@@ -278,7 +293,7 @@ const processContextsB = async ({ config, hierarchy, semantics, generators, json
|
|
278
293
|
const contexts = setupContexts(json.contexts)
|
279
294
|
|
280
295
|
const objects = config.get('objects')
|
281
|
-
const args = { objects, isResponse: true, response: json, isTest, isInstance, getObjects: getObjects(objects), instance }
|
296
|
+
const args = { objects, isResponse: true, response: json, isTest, isInstance, getObjects: getObjects(objects), instance, contexts }
|
282
297
|
if (!json.logs) {
|
283
298
|
json.logs = []
|
284
299
|
}
|