refactor: remove duplicate assignment on pkg (#66)

pull/67/head
Clark Du 2018-08-03 16:56:48 +01:00 zatwierdzone przez Amio /
rodzic a503df8745
commit 6dae7effa8
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -36,13 +36,12 @@ module.exports = async function npm (topic, ...args) {
async function pkg (topic, args) {
let pkg = args[0]
let tag = 'latest'
let isScoped = args[0].charAt(0) === '@'
const isScoped = args[0].charAt(0) === '@'
if (isScoped) {
pkg = `${args[0]}/${args[1]}`
tag = args[2] || tag
} else {
pkg = `${args[0]}`
tag = args[1] || tag
}