File tree 5 files changed +10
-18
lines changed
5 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 1
- export interface UserInfo {
1
+ export type UserInfo = {
2
2
/**
3
3
The user's name.
4
4
*/
@@ -23,7 +23,7 @@ export interface UserInfo {
23
23
The user's associated Twitter account.
24
24
*/
25
25
twitter : string | undefined ;
26
- }
26
+ } ;
27
27
28
28
/**
29
29
Get user info of an npm user.
@@ -38,9 +38,7 @@ console.log(await npmUser('sindresorhus'));
38
38
// {
39
39
// name: 'Sindre Sorhus',
40
40
// avatar: 'https://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?size=496',
41
- // email: 'sindresorhus@gmail .com',
42
- // github: 'sindresorhus',
43
- // twitter: 'sindresorhus'
41
+ // email: 'sindresorhus@gmail .com'
44
42
// }
45
43
```
46
44
*/
Original file line number Diff line number Diff line change 1
1
import { expectType } from 'tsd' ;
2
- import npmUser , { UserInfo } from './index.js' ;
2
+ import npmUser , { type UserInfo } from './index.js' ;
3
3
4
4
const userInfoPromise = npmUser ( 'sindresorhus' ) ;
5
5
expectType < Promise < UserInfo > > ( userInfoPromise ) ;
Original file line number Diff line number Diff line change 8
8
"author" : {
9
9
"name" : " Sindre Sorhus" ,
10
10
"email" : " sindresorhus@gmail.com" ,
11
- "url" : " sindresorhus.com"
11
+ "url" : " https:// sindresorhus.com"
12
12
},
13
13
"type" : " module" ,
14
14
"exports" : " ./index.js" ,
37
37
],
38
38
"dependencies" : {
39
39
"cheerio" : " ^0.22.0" ,
40
- "got" : " ^12.0.4 " ,
40
+ "got" : " ^12.5.3 " ,
41
41
"npm-email" : " ^4.0.1"
42
42
},
43
43
"devDependencies" : {
44
- "ava" : " ^4 .2.0" ,
45
- "tsd" : " ^0.20 .0" ,
46
- "xo" : " ^0.48.0 "
44
+ "ava" : " ^5 .2.0" ,
45
+ "tsd" : " ^0.25 .0" ,
46
+ "xo" : " ^0.53.1 "
47
47
}
48
48
}
Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ console.log(await npmUser('sindresorhus'));
22
22
{
23
23
name: 'Sindre Sorhus',
24
24
avatar: 'https://gravatar.com/avatar/d36a92237c75c5337c17b60d90686bf9?size=496',
25
- email: 'sindresorhus@gmail.com',
26
- github: 'sindresorhus',
27
- twitter: 'sindresorhus'
25
+ email: 'sindresorhus@gmail.com'
28
26
}
29
27
*/
30
28
```
Original file line number Diff line number Diff line change @@ -6,17 +6,13 @@ test('user: sindresorhus', async t => {
6
6
t . is ( user . name , 'Sindre Sorhus' ) ;
7
7
t . regex ( user . avatar , / n p m - a v a t a r / ) ;
8
8
t . is ( user . email , 'sindresorhus@gmail.com' ) ;
9
- t . is ( user . github , 'sindresorhus' ) ;
10
- t . is ( user . twitter , 'sindresorhus' ) ;
11
9
} ) ;
12
10
13
11
test ( 'user: npm' , async t => {
14
12
const user = await npmUser ( 'npm' ) ;
15
13
t . is ( user . name , 'No Problem, Meatbag' ) ;
16
14
t . regex ( user . avatar , / n p m - a v a t a r / ) ;
17
15
t . is ( user . email , 'npm@npmjs.com' ) ;
18
- t . is ( user . github , 'npm' ) ;
19
- t . is ( user . twitter , 'npmjs' ) ;
20
16
} ) ;
21
17
22
18
test ( 'user: tj' , async t => {
You can’t perform that action at this time.
0 commit comments