return abi if passed as target
This commit is contained in:
Родитель
ae3fd2f673
Коммит
f7586499bd
3
index.js
3
index.js
|
@ -1,4 +1,7 @@
|
|||
function getAbi (target, runtime) {
|
||||
if (typeof target === 'number' || target == Number(target)) {
|
||||
return String(target)
|
||||
}
|
||||
if (target) target = target.replace(/^v/, '')
|
||||
|
||||
if (runtime === 'electron') {
|
||||
|
|
|
@ -60,3 +60,9 @@ test('getAbi supports leading v', function (t) {
|
|||
t.equal(getAbi('v7.2.0'), '51')
|
||||
t.end()
|
||||
})
|
||||
|
||||
test('getAbi returns abi if passed as target', function (t) {
|
||||
t.equal(getAbi(57), '57')
|
||||
t.equal(getAbi('57'), '57')
|
||||
t.end()
|
||||
})
|
||||
|
|
Загрузка…
Ссылка в новой задаче