UNPKG
typeas
Version:
latest (0.0.1)
0.0.1
Library for checking data values and type safety
github.com/openorson/typeas
typeas
/
src
/
types
/
join.ts
7 lines
(6 loc)
•
294 B
text/typescript
View Raw
1
2
3
4
5
6
7
export
type
Join
<S
extends
readonly
string
[], D
extends
string
, F
extends
boolean
=
true
> = S
extends
readonly
[ infer A
extends
string
, ...infer B
extends
string
[] ] ?
`
${F
extends
true
?
""
: A
extends
""
?
""
: D}
${A}
${B[
"length"
]
extends
0
?
""
: Join<B, D,
false
>}
`
:
never
;