MCPcopy
hub / github.com/wavetermdev/waveterm / getFileNameFromUrl

Function getFileNameFromUrl

emain/emain-ipc.ts:71–79  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

69}
70
71function getFileNameFromUrl(url: string): string {
72 try {
73 const pathname = new URL(url).pathname;
74 const filename = pathname.substring(pathname.lastIndexOf("/") + 1);
75 return filename;
76 } catch (e) {
77 return null;
78 }
79}
80
81function getUrlInSession(session: Electron.Session, url: string): Promise<UrlInSessionResult> {
82 return new Promise((resolve, reject) => {

Callers 1

getUrlInSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected