EnumerableMap.opts.js 436 B

123456789101112131415161718
  1. const mapType = str => (str == 'uint256' ? 'Uint' : `${str.charAt(0).toUpperCase()}${str.slice(1)}`);
  2. const formatType = (keyType, valueType) => ({
  3. name: `${mapType(keyType)}To${mapType(valueType)}Map`,
  4. keyType,
  5. valueType,
  6. });
  7. const TYPES = [
  8. ['uint256', 'uint256'],
  9. ['uint256', 'address'],
  10. ['address', 'uint256'],
  11. ['bytes32', 'uint256'],
  12. ].map(args => formatType(...args));
  13. module.exports = {
  14. TYPES,
  15. formatType,
  16. };