qsu
Version:
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
1 lines • 252 B
JavaScript
import{posix as e,win32 as n}from"path";export function getFileName(t,i=!1){const a=!i&&!t.endsWith("/")&&!t.endsWith("\\");return-1===t.indexOf("/")&&-1!==t.indexOf("\\")?n.basename(t,a?n.extname(t):void 0)||"":e.basename(t,a?e.extname(t):void 0)||""}