bpms_site/.svn/pristine/66/66979c130d7c0c6f609a451c4ecbfc2fcb2cd998.svn-base
2025-11-02 16:38:49 +03:30

13 lines
432 B
Plaintext

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, prefix) {
if (!path.startsWith("/") || !prefix) {
return path;
}
const { pathname, query, hash } = parsePath(path);
return "" + prefix + pathname + query + hash;
}
//# sourceMappingURL=add-path-prefix.js.map