silverwolf-x's picture
download
raw
391 Bytes
import { parsePath } from './parse-path'
/**
* Adds the provided prefix to the given path. It first ensures that the path
* is indeed starting with a slash.
*/
export function addPathPrefix(path: string, prefix?: string) {
if (!path.startsWith('/') || !prefix) {
return path
}
const { pathname, query, hash } = parsePath(path)
return `${prefix}${pathname}${query}${hash}`
}

Xet Storage Details

Size:
391 Bytes
·
Xet hash:
c0de15efb551f86039e23c4765ce8ff82771b907cdf287e2b7e84f71441d7681

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.