Files
obsidian-livesync/src/serviceModules/FileSystemAdapters/ObsidianPathAdapter.ts
T
vorotamoroz c03fa5213f fix imports
2026-06-11 04:28:07 +01:00

17 lines
534 B
TypeScript

import { type TAbstractFile, normalizePath } from "@/deps";
import type { FilePath } from "@lib/common/models/db.type";
import type { IPathAdapter } from "@lib/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);
}
}