theprogrammablemind_4wp 8.3.0-beta.1 → 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 CHANGED
@@ -65,6 +65,6 @@
65
65
  "sort-json": "^2.0.0",
66
66
  "uuid": "^8.3.2"
67
67
  },
68
- "version": "8.3.0-beta.1",
68
+ "version": "8.3.0-beta.2",
69
69
  "license": "UNLICENSED"
70
70
  }
@@ -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
- if (child.marker) {
48
- child = child.marker
49
- }
50
- if (parent.marker) {
51
- parent = parent.marker
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 {