tra-analysis/website/node_modules/npm/lib/utils/is-registry.js

12 lines
294 B
JavaScript
Raw Normal View History

2019-01-06 19:14:45 +00:00
'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
}