8000 Update syncDeps.js · wadetandy/vue-cli@4c0b075 · GitHub
[go: up one dir, main page]

8000 Skip to content

Commit 4c0b075

Browse files
authored
Update syncDeps.js
1 parent 7dd51be commit 4c0b075

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

scripts/syncDeps.js

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,18 @@ const localPackageRE = /'(@vue\/(?:cli|eslint|babel)[\w-]+)': '\^([\w-.]+)'/g
1818

1919
const versionCache = {}
2020

21-
const getRequest = uri => {
22-
request({
23-
method: 'GET',
24-
resolveWithFullResponse: true,
25-
uri
26-
})
27-
}
28-
2921
const getRemoteVersion = async (pkg) => {
3022
if (versionCache[pkg]) {
3123
return versionCache[pkg]
3224
}
3325
let res
3426
try {
35-
res = await getRequest(`http://registry.npmjs.org/${pkg}/latest`)
27+
res = await request(`http://registry.npmjs.org/${pkg}/latest`)
3628
} catch (e) {
3729
return
3830
}
39-
const version = res.data.version
40-
versionCache[pkg] = version
41-
return version
31+
versionCache[pkg] = res.version
32+
return res.version
4233
}
4334

4435
const getRemoteVersionSync = pkg => {

0 commit comments

Comments
 (0)
0