mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
6c2bc2fe8b
History migration: Fix bug that prevents renamed files being automatically selected GitOrigin-RevId: ce127b218d1eb472fe7b35467a17549f3db4bfb7
13 lines
494 B
TypeScript
13 lines
494 B
TypeScript
import type { FileDiff, FileRemoved, FileRenamed } from '../services/types/file'
|
|
|
|
export function isFileRenamed(fileDiff: FileDiff): fileDiff is FileRenamed {
|
|
return (fileDiff as FileRenamed).operation === 'renamed'
|
|
}
|
|
|
|
export function isFileRemoved(fileDiff: FileDiff): fileDiff is FileRemoved {
|
|
return (fileDiff as FileRemoved).operation === 'removed'
|
|
}
|
|
|
|
export function fileFinalPathname(fileDiff: FileDiff) {
|
|
return isFileRenamed(fileDiff) ? fileDiff.newPathname : fileDiff.pathname
|
|
}
|