theprogrammablemind 8.3.0-beta.1 → 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 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 {