EnumerableMap.opts.js 455 B

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