UNPKG
@vectara/vectara-ui
Version:
latest (18.4.0)
18.4.0
18.3.0
18.2.3
18.2.2
18.2.1
18.2.0
18.1.1
18.1.0
18.0.1
18.0.0
17.4.0
17.3.1
17.3.0
17.2.0
17.1.0
17.0.1
17.0.0
16.12.0
16.11.0
16.10.0
16.9.0
16.8.0
16.7.0
16.6.0
16.5.1
16.5.0
16.4.1
16.4.0
16.3.1
16.3.0
16.2.0
16.1.2
16.1.1
16.1.0
16.0.1
16.0.0
15.9.6
15.9.5
15.9.4
15.9.3
15.9.2
15.9.1
15.9.0
15.8.0
15.7.2
15.7.1
15.7.0
15.6.5
15.6.2
15.6.1
15.6.0
15.5.3
15.5.2
15.5.1
15.5.0
15.4.1
15.4.0
15.3.1
15.3.0
15.2.0
15.1.0
15.0.3
15.0.2
15.0.1
15.0.0
14.3.1
14.3.0
14.2.0
14.1.4
14.1.3
14.1.2
14.1.1
14.1.0
14.0.2
14.0.1
14.0.0
13.16.3
13.16.2
13.16.1
13.16.0
13.15.0
13.14.1
13.14.0
13.13.5
13.13.4
13.13.3
13.13.1
13.13.0
13.12.0
13.11.3
13.11.2
13.11.1
13.11.0
13.10.0
13.9.0
13.8.0
13.7.0
13.6.0
13.5.0
13.4.0
13.3.1
13.3.0
13.2.4
13.2.3
13.2.0
13.1.1
13.1.0
13.0.0
12.2.1
12.2.0
12.1.1
12.1.0
12.0.2
12.0.1
12.0.0
11.2.1
11.2.0
11.1.1
11.1.0
11.0.2
11.0.1
10.0.1
10.0.0
9.17.1
9.17.0
9.16.1
9.16.0
9.15.0
9.14.1
9.14.0
9.13.0
9.12.0
9.11.2
9.11.1
9.11.0
9.10.1
9.10.0
9.9.0
9.8.7
9.8.6
9.8.5
9.8.4
9.8.3
9.8.2
9.8.1
9.8.0
9.7.0
9.6.0
9.5.3
9.5.2
9.5.1
9.5.0
9.4.2
9.4.1
9.4.0
9.3.1
9.3.0
9.2.6
9.2.5
9.2.4
9.2.3
9.2.2
9.2.1
9.2.0
9.1.2
9.1.1
9.1.0
3.5.0
3.4.0
3.1.0
1.0.2
1.0.1
0.0.4
0.0.2
Vectara's design system, codified as a React and Sass component library
.
vectara/vectara-ui
@vectara/vectara-ui
/
lib
/
utils
/
testIdify.js
8 lines
(7 loc)
•
218 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
// Convert a string into a value that's safe to use as a data-testid attribute.
export
const
testIdify
= (
str
) => {
if
(!str) {
return
""
; }
return
str.
replace
(
/ /g
,
"-"
).
replace
(
/[@.+]/g
,
"-"
); };