tagFromSmallLetter
Script
v10
Fork
1
2
3
4
5
6
7
8
9
export
const
tagFromSmallLetter
=
(
char
:
string
)
=>
{
if
(
char
.
length
!==
1
)
{
throw
new
Error
(
"Must be a single character"
)
;
}
if
(
char
<
"a"
||
char
>
"z"
)
{
throw
new
Error
(
"Must be a-z"
)
;
}
return
0xE0000
+
char
.
charCodeAt
(
0
)
;
}
;