is-registry.js 294 B

1234567891011
  1. 'use strict'
  2. module.exports = isRegistry
  3. function isRegistry (req) {
  4. if (req == null) return false
  5. // modern metadata
  6. if ('registry' in req) return req.registry
  7. // legacy metadata
  8. if (req.type === 'range' || req.type === 'version' || req.type === 'tag') return true
  9. return false
  10. }