@ark/schema
Advanced tools
Comparing version 0.18.0 to 0.19.0
@@ -70,7 +70,9 @@ import { arrayEquals, liftArray, throwParseError } from "@ark/util"; | ||
...defineRightwardIntersections("morph", (l, r, ctx) => { | ||
const inTersection = intersectOrPipeNodes(l.in, r, ctx); | ||
return inTersection instanceof Disjoint ? inTersection : (inTersection.distribute(branch => ({ | ||
...l.inner, | ||
in: branch | ||
}), ctx.$.parseSchema)); | ||
const inTersection = l.inner.in ? intersectOrPipeNodes(l.inner.in, r, ctx) : r; | ||
return (inTersection instanceof Disjoint ? inTersection | ||
: inTersection.equals(l.inner.in) ? l | ||
: ctx.$.node("morph", { | ||
...l.inner, | ||
in: inTersection | ||
})); | ||
}) | ||
@@ -77,0 +79,0 @@ } |
@@ -36,15 +36,7 @@ import { Disjoint } from "./disjoint.js"; | ||
return l; | ||
let result; | ||
if (isPureIntersection) { | ||
if (l.equals(r)) | ||
return l; | ||
result = _intersectNodes(l, r, ctx); | ||
} | ||
else { | ||
result = | ||
l.hasKindIn(...rootKinds) ? | ||
// if l is a RootNode, r will be as well | ||
_pipeNodes(l, r, ctx) | ||
: _intersectNodes(l, r, ctx); | ||
} | ||
let result = isPureIntersection ? _intersectNodes(l, r, ctx) | ||
: l.hasKindIn(...rootKinds) ? | ||
// if l is a RootNode, r will be as well | ||
_pipeNodes(l, r, ctx) | ||
: _intersectNodes(l, r, ctx); | ||
if (isNode(result)) { | ||
@@ -51,0 +43,0 @@ // if the result equals one of the operands, preserve its metadata by |
{ | ||
"name": "@ark/schema", | ||
"version": "0.18.0", | ||
"version": "0.19.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
354246
8293