UNPKG

node-uci

Version:

Universal Chess Interface protocol implementation for node.js

10 lines (8 loc) 211 B
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], } }