ultisuite-client/lib/drive/share-path-looks-like-editor.ts
R3D347HR4Y 303b2b1074
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
wow
2026-06-11 01:22:40 +02:00

17 lines
515 B
TypeScript

import {
shouldOpenInOnlyOffice,
shouldOpenInRichTextEditor,
shouldOpenInUltidrawEditor,
} from "@/lib/drive/drive-preview"
/** Best-effort guess from a public share URL path (before API metadata). */
export function sharePathLooksLikeEditorFile(path: string): boolean {
const name = path.replace(/^\/+|\/+$/g, "").split("/").pop() ?? ""
if (!name) return false
return (
shouldOpenInRichTextEditor({ name }) ||
shouldOpenInUltidrawEditor({ name }) ||
shouldOpenInOnlyOffice({ name })
)
}