(data: unknown, path: string)
| 19 | } |
| 20 | |
| 21 | function getNestedValue(data: unknown, path: string): unknown { |
| 22 | const normalizedPath = path.replace(/\[(\d+)\]/g, ".$1"); |
| 23 | const segments = normalizedPath.split(".").filter(Boolean); |
| 24 | |
| 25 | let current: unknown = data; |
| 26 | for (const segment of segments) { |
| 27 | if (!current || typeof current !== "object" || !(segment in current)) { |
| 28 | return undefined; |
| 29 | } |
| 30 | |
| 31 | current = (current as Record<string, unknown>)[segment]; |
| 32 | } |
| 33 | |
| 34 | return current; |
| 35 | } |
| 36 | |
| 37 | export function parseShareXConfig(configText: string): ShareXUploaderConfig { |
| 38 | let parsed: unknown; |
no outgoing calls
no test coverage detected