This commit is contained in:
jarek committed 2026-07-25 08:41:01 +02:00
1 parent 9f09d60a83
commit 64b6dcd744
177 files changed
+21182 -1042

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
/**
* Repository / environment predicates — pure, dependency-free.
*
* These live here (NOT in $lib/utils/backup.ts) because that module imports
* lucide-svelte for its icon helpers, which pulls the icon library into the
* server bundle. Server routes need only these predicates, so three of them had
* hand-inlined copies (bug #37 / audit 03-medium-low). One lucide-free module,
* re-exported by $lib/utils/backup.ts, removes the copies and the drift risk.
*/
/** A restic repository that is a local filesystem path (not a cloud/REST URL). */
export function isLocalRepo(repository: string): boolean {
return repository.startsWith('/') || repository.startsWith('./');
}
/** An environment reachable over the network (hawser or direct-with-host). */
export function isRemoteEnvironment(env?: { connectionType?: string | null; host?: string | null }): boolean {
if (!env) return false;
if (env.connectionType === 'hawser-standard' || env.connectionType === 'hawser-edge') return true;
if (env.connectionType === 'direct' && !!env.host) return true;
return false;
}