code: function findExternal(source, externals, context) {
    if (!externals) return false
  
    // string match
    if (typeof externals === 'string') return (source === externals)
  
    // array: recurse
    if (externals instanceof Array) {
      return externals.some(function (e) { return findExternal(source, e, context) })
    }
  
    if (externals instanceof RegExp) {
      return externals.test(source)
    }
  
    if (typeof externals === 'function') {
      var functionExternalFound = false
      externals.call(null, context, source, function(err, value) {
        if (err) {
          functionExternalFound = false
        } else {
          functionExternalFound = findExternal(source, value, context)
        }
      })
      return functionExternalFound
    }
  
    // else, vanilla object
    for (var key in externals) {
      if (!has(externals, key)) continue
      if (source === key) return true
    }
    return false
  }
docs: /* eslint-enable