title: Typescript async/await not working
body: <p>I've a problem about async/await on typescript with target es2017. Below is my code :</p>
  
  <p>my route.ts :</p>
  
  <pre><code>method: 'POST',
          config: {            
              auth: {
                  strategy: 'token',        
              }
          },
          path: '/users',
          handler: (request, reply) {
  
      let { username, password } = request.payload;
  
      const getOperation = User
      .findAll({
          where: {
              username: username
          }
      })
      .then(([User]) =&gt; {
          if(!User) {
              reply({
                  error: true,
                  errMessage: 'The specified user was not found'
              });
              return;
          }
  
          let comparedPassword = compareHashPassword(User.password, password);
          console.log(comparedPassword);
  
          if(comparedPassword) {
              const token = jwt.sign({
                  username,
                  scope: User.id
  
              }, 'iJiYpmaVwXMp8PpzPkWqc9ShQ5UhyEfy', {
                  algorithm: 'HS256',
                  expiresIn: '1h'
              });
  
              reply({
                  token,
                  scope: User.id
              });
          } else {
              reply('incorrect password');
          }
      } )
      .catch(error =&gt; { reply('server-side error') });
  
  };
  </code></pre>
  
  <p>my helper.ts :</p>
  
  <pre><code>export async function compareHashPassword(pw:string, originalPw:string) {
      console.log(pw);
      console.log(originalPw);
      let compared = bcrypt.compare(originalPw, pw, function(err, isMatch) {
          if(err) {
                  return console.error(err);
          }
          console.log(isMatch);
          return isMatch;
          });
  
      return await compared;
  }
  </code></pre>
  
  <p>this auth route supposed to return JWT token when user login. but the problem here is even when I enter the valid password to sign-in the function compareHashPassword always return undefined.</p>
  
  <p>For example when i call the api with json string </p>
  
  <pre><code>{
    "username": "x",
    "password": "helloword"
  }
  </code></pre>
  
  <p>When i track using console.log(), the log is : </p>
  
  <pre><code>$2a$10$Y9wkjblablabla -&gt; hashed password stored in db
  helloword 
  Promise {
    &lt;pending&gt;,
    domain: 
     Domain {
       domain: null,
       _events: { error: [Function: bound ] },
       _eventsCount: 1,
       _maxListeners: undefined,
       members: [] } }
  true
  </code></pre>
  
  <p>maybe this is just my lack of understanding about using async/await with typescript. for note my env is :</p>
  
  <pre><code>node : v8.6.0
  typescript : v2.5.2
  ts-node : v3.3.0
  my tsconfig.json //
  {
      "compilerOptions": {
          "outDir": "dist",
          "target": "es2017",
          "module": "commonjs",
          "removeComments": true,
          "types": [
              "node"
          ],
          "allowJs": true,
          "moduleResolution": "classic"
      },
      "exclude": [
          "node_modules"
      ]
  }
  </code></pre>