29 lines · 928 B · TypeScript
RawDownload
export const WORKSPACE_BROWSER_PREVIEW_EXTENSIONS = [".htm", ".html", ".pdf"] as const; export const WORKSPACE_IMAGE_PREVIEW_EXTENSIONS = [  ".avif",  ".gif",  ".ico",  ".jpeg",  ".jpg",  ".png",  ".svg",  ".webp",] as const; function hasPreviewExtension(path: string, extensions: ReadonlyArray<string>): boolean {  const pathWithoutQuery = path.split(/[?#]/, 1)[0]?.toLowerCase() ?? "";  return extensions.some((extension) => pathWithoutQuery.endsWith(extension));} export function isWorkspaceBrowserPreviewPath(path: string): boolean {  return hasPreviewExtension(path, WORKSPACE_BROWSER_PREVIEW_EXTENSIONS);} export function isWorkspaceImagePreviewPath(path: string): boolean {  return hasPreviewExtension(path, WORKSPACE_IMAGE_PREVIEW_EXTENSIONS);} export function isWorkspacePreviewEntryPath(path: string): boolean {  return isWorkspaceBrowserPreviewPath(path) || isWorkspaceImagePreviewPath(path);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t