Files
obsidian-livesync/src/serviceModules/FileSystemAdapters/ObsidianPathAdapter.ts
T
2026-07-17 11:13:16 +00:00

17 lines
583 B
TypeScript

import { type TAbstractFile, normalizePath } from "@/deps";
import type { FilePath } from "@vrtmrz/livesync-commonlib/compat/common/types";
import type { IPathAdapter } from "@vrtmrz/livesync-commonlib/compat/serviceModules/adapters";
/**
* Path adapter implementation for Obsidian
*/
export class ObsidianPathAdapter implements IPathAdapter<TAbstractFile> {
getPath(file: string | TAbstractFile): FilePath {
return (typeof file === "string" ? file : file.path) as FilePath;
}
normalisePath(path: string): string {
return normalizePath(path);
}
}