title: Type 'undefined' is not assignable to type 'string | Buffer | { key: string | Buffer; passphrase: string; } | GetPublicKeyOrSecret'
body: <p><strong>JWT Verification Code</strong>
  This is verification function to verify jwt using typescript.</p>
  <pre><code>public verify(
      token: string,
      secretOrPublicKey?: string | Buffer,
      options?: jwt.VerifyOptions
    ): Promise&lt;object | string&gt; {
      if (!secretOrPublicKey) {
        secretOrPublicKey = this.secretOrPublicKey;
      }
  
      return new Promise((resolve, reject) =&gt; {
        jwt.verify(
          token,
          secretOrPublicKey,
          options,
          (err: jwt.VerifyErrors, decoded: object | string) =&gt; {
            if (err) {
              reject(err);
            } else {
              resolve(decoded);
            }
          }
        );
      });
    }
  </code></pre>
  <p>And I found waring line on <code>secrectOrPublicKey</code> that is following and how to solve this please. Any comment would very helpful to me.</p>
  <p><code>(parameter) secretOrPublicKey: string | Buffer | undefined Argument of type 'string | Buffer | undefined' is not assignable to parameter of type 'string | Buffer | { key: string | Buffer; passphrase: string; } | GetPublicKeyOrSecret'. Type 'undefined' is not assignable to type 'string | Buffer | { key: string | Buffer; passphrase: string; } | GetPublicKeyOrSecret'.ts(2345)</code></p>