Send files directly between devices over the internet - no cloud storage, no size limits.
TypeScript cross-platformdata-transferdecentralizedfile-sharingfile-transferhole-punchingopen-sourcep2ppeer-to-peerprivacyprivacy-tools
export function getParentDir(filePath: string): string {
const lastSlash = Math.max(filePath.lastIndexOf('/'), filePath.lastIndexOf('\\'))
return lastSlash > 0 ? filePath.slice(0, lastSlash) : filePath
}
export function shortenHomePath(p: string): string {
const home = p.match(/^\/Users\/[^/]+/)?.[0]
return home ? p.replace(home, '~') : p
}