mirror of
https://github.com/coder/code-server.git
synced 2024-12-11 23:04:03 +03:00
Use ?? for base default
This commit is contained in:
parent
10c2b956ac
commit
3badf6bf7b
@ -46,7 +46,7 @@ export const trimSlashes = (url: string): string => {
|
|||||||
export const resolveBase = (base?: string): string => {
|
export const resolveBase = (base?: string): string => {
|
||||||
// After resolving the base will either start with / or be an empty string.
|
// After resolving the base will either start with / or be an empty string.
|
||||||
if (!base || base.startsWith("/")) {
|
if (!base || base.startsWith("/")) {
|
||||||
return base || ""
|
return base ?? ""
|
||||||
}
|
}
|
||||||
const parts = location.pathname.split("/")
|
const parts = location.pathname.split("/")
|
||||||
parts[parts.length - 1] = base
|
parts[parts.length - 1] = base
|
||||||
|
Loading…
Reference in New Issue
Block a user