FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ipython.github.com/src/lib/utils.ts at main · ipython/ipython.github.com · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
ipython
/
ipython.github.com
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
16
Star
11
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ipython.github.com
/
src
/
lib
/
utils.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (18 loc) · 692 Bytes
Breadcrumbs
ipython.github.com
/
src
/
lib
/
utils.ts
Copy path
File metadata and controls
21 lines (18 loc) · 692 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import
{
type
ClassValue
,
clsx
}
from
"clsx"
;
import
{
twMerge
}
from
"tailwind-merge"
;
export
function
cn
(
...
inputs
:
ClassValue
[
]
)
{
return
twMerge
(
clsx
(
inputs
)
)
;
}
export
type
ObjectValues
<
T
>
=
T
[
keyof
T
]
;
/**
* Join a path with the base URL, ensuring proper slashes
* Handles cases where BASE_URL may or may not end with /
*/
export
function
baseUrl
(
path
:
string
)
:
string
{
const
base
=
import
.
meta
.
env
.
BASE_URL
;
// Remove leading slash from path if present
const
cleanPath
=
path
.
startsWith
(
'/'
)
?
path
.
slice
(
1
)
:
path
;
// Ensure base ends with /, then concatenate
const
baseWithSlash
=
base
.
endsWith
(
'/'
)
?
base
:
`
${
base
}
/`
;
return
`
${
baseWithSlash
}
${
cleanPath
}
`
;
}
Back
|
FazBrowse Home
|
New Git URL