mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add test and related fix
This commit is contained in:
parent
109298354c
commit
ed28cd0b50
2
types/jsonwebtoken/index.d.ts
vendored
2
types/jsonwebtoken/index.d.ts
vendored
@ -166,4 +166,4 @@ declare function verify(
|
||||
declare function decode(
|
||||
token: string,
|
||||
options?: DecodeOptions,
|
||||
): null | object | string;
|
||||
): null | { [key: string]: any } | string;
|
||||
|
||||
@ -111,6 +111,10 @@ var decoded = jwt.decode(token);
|
||||
|
||||
decoded = jwt.decode(token, { complete: false });
|
||||
|
||||
if (decoded !== null && typeof decoded === "object") {
|
||||
console.log(decoded.foo);
|
||||
}
|
||||
|
||||
decoded = jwt.decode(token, { json: false });
|
||||
|
||||
decoded = jwt.decode(token, { complete: false, json: false });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user