title: How to structure input parameter to object in JS
body: <p>I have a simple Express API here.
  When the user submits the chain param I want to convert the parameter to an object.
  Depending on the input the object will have different values
  Right now I just have a bunch of if statements stacked</p>
  <p>Is there a better practice solution to implement this as this is quite clunky?</p>
  <pre><code>app.get('/gettokens/:chain/:address', async(req, res) =&gt; {
      const address = req.params.address;
      let chain = req.params.chain;
  
      if (chain == 'bsc') {
          chain = {
              moralis: 'bsc',
              coingecko: 'binance-smart-chain'
          }
      }
  
      if (chain == 'eth') {
          chain = {
              moralis: 'eth',
              coingecko: 'ethereum'
          }
      }
  
      if (chain == 'avax') {
          chain = {
              moralis: 'avalanche',
              coingecko: 'avalanche'
          }
      }
  
      if (chain == 'matic') {
          chain = {
              moralis: 'matic',
              coingecko: 'polygon-pos'
          }
      }
  </code></pre>