theprogrammablemind_4wp 8.3.0-beta.0 → 8.3.0-beta.2
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 +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 {
|