Skip to content

Commit ecb19a0

Browse files
authored
Merge pull request #83 from eesteban/chore-types
chore(types): add types
2 parents 39074d7 + 0ddd127 commit ecb19a0

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

History.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.2
2+
3+
Add types #83
4+
15
## 0.5.0
26

37
Add support for nbf and exp claims #38 @alexjab

index.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export type TAlgorithm = 'HS256' | 'HS384' | 'HS512' | 'RS256';
2+
3+
export interface IOptions {
4+
header: any;
5+
}
6+
7+
export function decode(token: string, key: string, noVerify?: boolean, algorithm?: TAlgorithm): any;
8+
9+
export function encode(payload: any, key: string, algorithm?: TAlgorithm, options?: IOptions): string;

lib/jwt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var jwt = module.exports;
4343
/**
4444
* version
4545
*/
46-
jwt.version = '0.5.1';
46+
jwt.version = '0.5.2';
4747

4848
/**
4949
* Decode jwt

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jwt-simple",
33
"description": "JWT(JSON Web Token) encode and decode module",
4-
"version": "0.5.1",
4+
"version": "0.5.2",
55
"author": "Kazuhito Hokamura <k.hokamura@gmail.com>",
66
"repository": {
77
"type": "git",
@@ -24,5 +24,7 @@
2424
"encode",
2525
"decode"
2626
],
27-
"main": "./index"
28-
}
27+
"main": "./index",
28+
"types": "./index.d.ts",
29+
"typings": "./index.d.ts"
30+
}

0 commit comments

Comments
 (0)