return paths

This commit is contained in:
Andras Schmelczer 2026-04-25 08:40:40 +01:00
parent c9cf3239db
commit aecbcd1d2c
12 changed files with 20 additions and 136 deletions

View file

@ -1,5 +1,3 @@
import type { RelativePath } from "./types";
// Local-only files displaced by `FileOperations.ensureClearPath` are named
// `conflict-<uuid>-<originalName>`. The UUID is a full RFC-4122 v4 value so
// a user-authored filename that happens to start with `conflict-` doesn't
@ -55,14 +53,3 @@ function truncateFileNameToByteLimit(
}
return truncatedStem + extension;
}
/**
* Is `path`'s final segment a conflict-displaced filename?
*
* Any sync code that would otherwise create/update/delete/sync the path
* should short-circuit when this returns true: conflict-displaced files are
* strictly local and must stay invisible to the server.
*/
export function isConflictPath(path: RelativePath): boolean {
return CONFLICT_PATH_REGEX.test(path);
}