add dr, dh flags

This commit is contained in:
2024-03-15 08:38:15 -05:00
parent b53c8c532e
commit 61b6dc8a35
5 changed files with 94 additions and 23 deletions

View File

@@ -157,12 +157,13 @@ exports.parsePositionLabel = (label) => {
const pattern = /(?<pos>[A-Z0-9]+)(?:\s\[(?<flags>.[A-z,]+)\])?/g
const {pos, flags} = pattern.exec(label)?.groups || {}
const positionLabelWithoutFlags= pos
const positionFlags = flags?.split(',').map(f=>f.trim()) || []
const positionFlags = new Set(flags?.split(',').map(f=>f.trim()) || [])
return {positionLabelWithoutFlags, positionFlags}
}
exports.compilePositionLabel = (label, flags) => {
if (flags == null || flags == '' || flags.lengh == 0) {
if (flags == null || flags == '' || flags.size == 0) {
return label
}
else {