UNPKG
gherkin
Version:
latest (9.0.0)
9.0.0
8.2.1
8.2.0
8.1.1
8.0.0
7.0.4
7.0.3
7.0.2
7.0.1
6.0.17
6.0.16
6.0.15
6.0.14
6.0.13
6.0.12
6.0.11
6.0.10
5.1.0
5.0.1
5.0.0
4.1.3
4.1.2
4.1.1
4.1.0
4.0.0
3.2.0
3.1.2
3.1.1
3.1.0
3.0.0
2.12.2
2.12.1
2.12.0
2.11.8
2.11.7
2.11.6
2.11.5
2.11.4
2.11.3
2.11.2
2.11.1
2.11.0
2.10.0
2.9.3
2.9.2
2.9.1
2.9.0
2.8.0
2.7.7
2.7.6
2.7.5
2.7.4
2.7.3
2.7.2
2.7.1
2.6.9
2.6.8
2.6.7
2.6.6
2.6.5
2.6.4
2.6.3
2.6.2
2.6.1
2.6.0
2.5.4
2.5.3
2.5.2
2.5.1
2.5.0
2.4.21
2.4.20
2.4.19
2.4.18
2.4.17
2.4.16
2.4.15
2.4.14
2.4.13
2.4.11
2.4.10
2.4.9
2.4.8
2.4.7
2.4.6
2.4.5
2.4.4
2.4.3
2.4.2
2.4.1
2.4.0
2.3.10
2.3.9
2.3.8
2.3.7
2.3.6
2.3.4
1.1.4
Gherkin parser
github.com/cucumber/gherkin-javascript
cucumber/gherkin-javascript
gherkin
/
src
/
countSymbols.ts
7 lines
(5 loc)
•
218 B
text/typescript
View Raw
1
2
3
4
5
6
7
// https://mathiasbynens.be/notes/javascript-unicode
const
regexAstralSymbols =
/[\uD800-\uDBFF][\uDC00-\uDFFF]/g
export
default
function
countSymbols
(
s: string
) {
return
s.
replace
(regexAstralSymbols,
'_'
).
length
}