theprogrammablemind 8.3.0-beta.0 → 8.3.0-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.
- package/package.json +1 -1
- package/src/configHelpers.js +22 -7
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 {
|