code: protected function resolvePackageInstallPreference(PackageInterface $package)
      {
          foreach ($this->packagePreferences as $pattern => $preference) {
              $pattern = '{^'.str_replace('\\*', '.*', preg_quote($pattern)).'$}i';
              if (preg_match($pattern, $package->getName())) {
                  if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) {
                      return 'dist';
                  }
  
                  return 'source';
              }
          }
  
          return $package->isDev() ? 'source' : 'dist';
      }
docs: Determines the install preference of a package
  
  @param PackageInterface $package package instance
  
  @return string