(dirPath: string, filePath: string)
| 44 | export type OnPatchGenerationComplete = (childWorkspaceId: string) => Promise<void>; |
| 45 | |
| 46 | function isPathInsideDir(dirPath: string, filePath: string): boolean { |
| 47 | const resolvedDir = path.resolve(dirPath); |
| 48 | const resolvedFile = path.resolve(filePath); |
| 49 | const relativePath = path.relative(resolvedDir, resolvedFile); |
| 50 | return ( |
| 51 | relativePath.length > 0 && !relativePath.startsWith("..") && !path.isAbsolute(relativePath) |
| 52 | ); |
| 53 | } |
| 54 | |
| 55 | async function writeReadableStreamToLocalFile( |
| 56 | stream: ReadableStream<Uint8Array>, |
no test coverage detected