File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -18,27 +18,18 @@ const localPackageRE = /'(@vue\/(?:cli|eslint|babel)[\w-]+)': '\^([\w-.]+)'/g
18
18
19
19
const versionCache = { }
20
20
21
- const getRequest = uri => {
22
- request ( {
23
- method : 'GET' ,
24
- resolveWithFullResponse : true ,
25
- uri
26
- } )
27
- }
28
-
29
21
const getRemoteVersion = async ( pkg ) => {
30
22
if ( versionCache [ pkg ] ) {
31
23
return versionCache [ pkg ]
32
24
}
33
25
let res
34
26
try {
35
- res = await getRequest ( `http://registry.npmjs.org/${ pkg } /latest` )
27
+ res = await request ( `http://registry.npmjs.org/${ pkg } /latest` )
36
28
} catch ( e ) {
37
29
return
38
30
}
39
- const version = res . data . version
40
- versionCache [ pkg ] = version
41
- return version
31
+ versionCache [ pkg ] = res . version
32
+ return res . version
42
33
}
43
34
44
35
const getRemoteVersionSync = pkg => {
You can’t perform that action at this time.
0 commit comments