@flowrunner/cli 0.1.18-dev.3 → 0.1.19-dev.1

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/dist/index.js CHANGED
@@ -16637,6 +16637,8 @@ function resolveTarget(plan2, segments, fieldValue) {
16637
16637
  let label = plan2.label;
16638
16638
  let found = true;
16639
16639
  for (const segment of segments) {
16640
+ const branch = schema && inspect(schema).branches?.find((candidate) => isIndex(segment) ? inspect(candidate).coreType === "array" : shapeEntries(inspect(candidate).core).some(([name]) => name === segment));
16641
+ schema = branch ?? schema;
16640
16642
  const core = schema ? inspect(schema).core : void 0;
16641
16643
  const coreType = core ? inspect(schema).coreType : void 0;
16642
16644
  value = value == null ? void 0 : value[segment];
@@ -16675,7 +16677,7 @@ function toFieldIssue(plan2, issue, fieldValue) {
16675
16677
  if (isAuthored(issue)) {
16676
16678
  return { path: path19, code, message: issue.message };
16677
16679
  }
16678
- if (code !== "invalid_union" && target.schema && inspect(target.schema).branches) {
16680
+ if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
16679
16681
  const combined = unionPhrases(target.schema, target.value);
16680
16682
  if (combined.length > 1) {
16681
16683
  return { path: path19, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
@@ -16705,6 +16707,9 @@ function toFieldIssue(plan2, issue, fieldValue) {
16705
16707
  return described ? { path: path19, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path19, code, message: `\xAB${target.label}\xBB has an invalid format` };
16706
16708
  }
16707
16709
  if (code === "invalid_union") {
16710
+ if (segments.length && target.found && target.value == null) {
16711
+ return { path: path19, code, message: requiredMessage(named) };
16712
+ }
16708
16713
  const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
16709
16714
  if (combined) {
16710
16715
  return combined.path ? combined : { path: path19, code, message: `\xAB${target.label}\xBB ${combined.message}` };