1
0

Update docs

This commit is contained in:
2022-06-04 17:29:50 +02:00
parent 695e1c0dfe
commit f846695242
2 changed files with 32 additions and 8 deletions

9
index.d.ts vendored
View File

@@ -33,9 +33,9 @@ declare class JWT {
* Returns the payload **without** verifying the integrity of the token. Please use `jwt.verify()` first to keep your application secure!
*
* @param {string} token The token string generated by `jwt.sign()`.
* @returns {object | null} Returns payload `object`.
* @returns {JWTDecodeReturn} Returns an `object` containing `header` and `payload`.
*/
decode(token: string): object | null
decode(token: string): JWTDecodeReturn
}
declare const _exports: JWT
@@ -52,4 +52,9 @@ type JWTVerifyOptions = {
throwError?: boolean
}
type JWTDecodeReturn = {
header: object,
payload: object
}
export = _exports