MCPcopy Create free account
hub / github.com/code-pushup/cli / formatNodeMessage

Function formatNodeMessage

packages/plugin-axe/src/lib/runner/transform.ts:77–85  ·  view source on GitHub ↗

* Joins `none`/`all` check messages (each must be fixed). * Falls back to first `any` check (OR-ed, one represents the group).

(node: axe.NodeResult, fallback: string)

Source from the content-addressed store, hash-verified

75 * Falls back to first `any` check (OR-ed, one represents the group).
76 */
77function formatNodeMessage(node: axe.NodeResult, fallback: string): string {
78 const requiredMessages = [...node.none, ...node.all].map(
79 check => check.message,
80 );
81 if (requiredMessages.length > 0) {
82 return requiredMessages.join('. ');
83 }
84 return node.any[0]?.message ?? fallback;
85}
86
87function toIssue(node: axe.NodeResult, result: axe.Result, url: string): Issue {
88 const selector = node.target?.[0]

Callers 1

toIssueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected