(config: any)
| 57 | })); |
| 58 | const mockMaybeLoadConfigFromExternalFileImpl = vi.hoisted(() => { |
| 59 | const implementation = (config: any): any => { |
| 60 | if (Array.isArray(config)) { |
| 61 | return config.map((item) => implementation(item)); |
| 62 | } |
| 63 | |
| 64 | if (typeof config === 'object' && config !== null) { |
| 65 | const result = { ...config }; |
| 66 | for (const [key, value] of Object.entries(config)) { |
| 67 | if (typeof value === 'string' && value.startsWith('file://')) { |
| 68 | const filePath = value.slice('file://'.length); |
| 69 | const fileContent = mockReadFileSync(filePath, 'utf-8'); |
| 70 | if (typeof fileContent === 'string') { |
| 71 | try { |
| 72 | result[key] = JSON.parse(fileContent); |
| 73 | } catch { |
| 74 | result[key] = fileContent; |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | return result; |
| 80 | } |
| 81 | |
| 82 | return config; |
| 83 | }; |
| 84 | |
| 85 | return implementation; |
| 86 | }); |
nothing calls this directly
no test coverage detected
searching dependent graphs…