UNPKG
@npio/internals
Version:
latest (0.65.1)
next (0.59.0-next.26)
0.65.1
0.65.0
0.64.1
0.64.0
0.63.0
0.62.1
0.62.0
0.61.0
0.60.0
0.59.0
0.59.0-next.26
0.59.0-next.25
0.59.0-next.24
0.59.0-next.23
0.59.0-next.22
0.59.0-next.21
0.59.0-next.20
0.59.0-next.19
0.59.0-next.18
0.59.0-next.17
0.59.0-next.16
0.59.0-next.15
0.59.0-next.14
0.59.0-next.13
0.59.0-next.12
0.59.0-next.11
0.59.0-next.10
0.59.0-next.9
0.59.0-next.8
0.59.0-next.7
0.59.0-next.6
0.59.0-next.5
0.59.0-next.4
0.59.0-next.3
0.59.0-next.2
0.59.0-next.1
0.59.0-next.0
A free visual website editor, powered with your own SolidJS components.
nitropage.org
@npio/internals
/
src
/
server
/
util
/
string.ts
12 lines
(9 loc)
•
208 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export const normalizeUrlPath = (
path
=
""
) => {
if
(!
path
.startsWith(
"/"
)) {
path
=
"/"
+
path
; }
if
(
path
.length >
1
&&
path
.endsWith(
"/"
)) {
path
=
path
.slice(
0
,
-1
); }
return
path
; };