protected function isLibrary(array $package) {
    // Add Swiftmailer support.
    if ($package['name'] == 'swiftmailer/swiftmailer') {
      $package['type'] = 'drupal-library';
    }

    $package_types = [
      'drupal-library',
      'bower-asset',
      'npm-asset',
    ];
    return (
      in_array($package['type'], $package_types) &&
      array_key_exists($package['name'], $this->rootPackage->getRequires())
    );
  }