MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formatIssuePath

Function formatIssuePath

packages/kernel/core/src/validation.ts:30–44  ·  view source on GitHub ↗
(
  path: ReadonlyArray<PropertyKey | StandardSchemaV1.PathSegment> | undefined,
)

Source from the content-addressed store, hash-verified

28};
29
30const formatIssuePath = (
31 path: ReadonlyArray<PropertyKey | StandardSchemaV1.PathSegment> | undefined,
32): string => {
33 if (!path || path.length === 0) {
34 return "$";
35 }
36
37 return path
38 .map((segment) =>
39 typeof segment === "object" && segment !== null && "key" in segment
40 ? String(segment.key)
41 : String(segment),
42 )
43 .join(".");
44};
45
46const formatIssues = (issues: ReadonlyArray<StandardSchemaV1.Issue>): string =>
47 issues.map((issue) => `${formatIssuePath(issue.path)}: ${issue.message}`).join("; ");

Callers 1

formatIssuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected