(base: string, filePath: string)
| 372 | } |
| 373 | |
| 374 | const fetchFilePath = async (base: string, filePath: string) => { |
| 375 | try { |
| 376 | if (!isPathSafe(base, filePath)) { |
| 377 | return { |
| 378 | response: new Response('Forbidden', { status: 403 }), |
| 379 | filePath, |
| 380 | base |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | const response = await net.fetch(`file://${filePath}`) |
| 385 | return { response, filePath, base } |
| 386 | } catch (error) { |
| 387 | return null |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | const migrateResourceFile = async ( |
| 392 | legacyFilePath: string, |
no test coverage detected