Exploit databaseDownload repository ZIP
GH-562a516151f045835c0ee477b90de486
barrersoftware/opencode-secure
Sources for CVE-2026-22812
6 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files10
barrersoftware/opencode-secureRevision 806a6c7399a1
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
packages/util/src/path.ts
TypeScript · 532 bytesexport function getFilename(path: string | undefined) {
if (!path) return ""
const trimmed = path.replace(/[\/\\]+$/, "")
const parts = trimmed.split(/[\/\\]/)
return parts[parts.length - 1] ?? ""
}
export function getDirectory(path: string | undefined) {
if (!path) return ""
const parts = path.split("/")
return parts.slice(0, parts.length - 1).join("/") + "/"
}
export function getFileExtension(path: string | undefined) {
if (!path) return ""
const parts = path.split(".")
return parts[parts.length - 1]
}