UNPKG
@ka1do/kit
Version:
latest (0.0.3)
0.0.3
Kaido Kit
github.com/kaido-team/kaido-kit
kaido-team/kaido-kit
@ka1do/kit
/
helpers
/
node_modules
/
@nodelib
/
fs.scandir
/
src
/
providers
/
common.ts
11 lines
(9 loc)
•
278 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
export
function
joinPathSegments
(
a
: string,
b
: string,
separator
: string):
string
{
/** * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). */
if
(a.
endsWith
(separator)) {
return
a
+
b
; }
return
a
+
separator
+
b
; }