title: TypeScript + Express : req.params
body: <p>I have the following express route :</p>
  
  <pre><code>app.get('/:id', function (req, res) {
    var idNum: number = Number(req.params.id);
    var idCast: number = +req.params.id;
    var id: number = req.params.id;
  
    console.log('typeof idNum ', typeof idNum , '  ', 'idNum== 0 :  ', idNum== 0  , '  ', 'idNum=== 0 :  ', idNum=== 0);
    console.log('typeof idCast', typeof idCast, '  ', 'idCast == 0 :', idCast == 0, '  ', 'idCast === 0 :', idCast === 0);
    console.log('typeof id    ', typeof id    , '  ', 'id == 0 :    ', id == 0    , '  ', 'id === 0 :'    , id === 0);
  
    res.json({});
  });
  </code></pre>
  
  <p>this returns : </p>
  
  <pre><code>typeof idNum  number    idNum== 0   : true    idNum=== 0   : true
  typeof idCast number    idCast == 0 : true    idCast === 0 : true
  typeof id     string    id == 0     : true    id === 0     : false
  </code></pre>
  
  <p>I understand that typescript provide only compile-time type-checking, and I guess it means it's not aware that req.params provide arguments as strings.</p>
  
  <p>Is there any way I can automatically cast my params to Number ? or at least raise an error of I didn't done it manually ? Else, it seems that tympescript, unless used in a full-typescript environnement is useless.</p>
  
  <p>Endly, is there any "big" open source project using TypeScript with ExpressJS that I could read the source from ?</p>