UNPKG
@twilio-paste/paste-reakit-fork
Version:
latest (1.4.1)
1.4.1
Forked Reakit that addresses SSR hydration issues
twilio-labs/paste-reakit
@twilio-paste/paste-reakit-fork
/
src
/
Combobox
/
__utils
/
getItemId.ts
8 lines
(6 loc)
•
220 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
function
kebabCase
(
string
:
string
) {
return
string
.
toLowerCase
().
replace
(
/[^a-z0-9]/g
,
"-"
); }
export
function
getItemId
(
baseId
:
string
,
value
:
string
,
id
?:
string
) {
return
id ||
`
${baseId}
-
${kebabCase(value)}
`
; }