const dictionary = async () => ({
'X': { field: '', domain: { '2': 2, '-2': -2, '0': 0 } },
'Y': { field: '', domain: { '2': 2, '-2': -2, '0': 0 } },
'result': { field: '', domain: { '4': 4, '-4': -4, '0': 0 } }
})
The value
The value should be a function. Look at your example. You have an entry for each number! 🤦🏻♂️ This doesn't make sense. What I'd like to do is:
'X': { field: '', domain: parseInt },
There might be cases where a map makes sense, but you have to come up with a better example for that.
The name
domain should be called "parser". Or, at least, "fromString". "domain" means nothing to us.