UNPKG
node-uci
Version:
latest (1.3.4)
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.0
1.0.0
0.0.1
Universal Chess Interface protocol implementation for node.js
ebemunk/node-uci
node-uci
/
src
/
parseUtil
/
parseId.js
10 lines
(8 loc)
•
211 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
import
{
REGEX
}
from
'../const'
export
default
function
parseId
(
line
) {
const
parsed =
REGEX
.
id
.
exec
(line)
if
(!parsed || !parsed[
1
] || !parsed[
2
])
return
null
return
{ [parsed[
1
]]: parsed[
2
], } }