MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / parseDurationMs

Function parseDurationMs

src/utils/xcodebuild-line-parsers.ts:133–150  ·  view source on GitHub ↗
(durationText?: string)

Source from the content-addressed store, hash-verified

131}
132
133export function parseDurationMs(durationText?: string): number | undefined {
134 if (!durationText) {
135 return undefined;
136 }
137
138 const normalized = durationText.trim().replace(/\s+seconds?$/u, 's');
139 const match = normalized.match(/^([\d.]+)s$/u);
140 if (!match) {
141 return undefined;
142 }
143
144 const seconds = Number(match[1]);
145 if (!Number.isFinite(seconds)) {
146 return undefined;
147 }
148
149 return Math.round(seconds * 1000);
150}
151
152export function parseBuildErrorDiagnostic(line: string): ParsedBuildError | null {
153 // File path with line number: /path/to/File.swift:42:10: error: message

Callers 2

recordTestCaseResultFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected