UNPKG
@tonyo/alpaga
Version:
latest (0.1.4)
0.1.4
0.1.3
0.1.2
0.1.1
Test package
github.com/tonyo/alpaga
tonyo/alpaga
@tonyo/alpaga
/
tmp
/
node-v10.15.0-win-x86
/
node_modules
/
npm
/
lib
/
utils
/
is-registry.js
12 lines
(10 loc)
•
305 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
'use strict'
module
.
exports
= isRegistry
function
isRegistry
(
req
) {
if
(req ==
null
)
return
false
// modern metadata
if
(
'registry'
in
req)
return
req.
registry
// legacy metadata
if
(req.
type
===
'range'
|| req.
type
===
'version'
|| req.
type
===
'tag'
)
return
true
return
false
}