Class: Dependabot::NpmAndYarn::UpdateChecker::LibraryDetector

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/npm_and_yarn/update_checker/library_detector.rb

Instance Method Summary collapse

Constructor Details

#initialize(package_json_file:, credentials:, dependency_files:) ⇒ LibraryDetector

Returns a new instance of LibraryDetector.



12
13
14
15
16
# File 'lib/dependabot/npm_and_yarn/update_checker/library_detector.rb', line 12

def initialize(package_json_file:, credentials:, dependency_files:)
  @package_json_file = package_json_file
  @credentials = credentials
  @dependency_files = dependency_files
end

Instance Method Details

#library?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
# File 'lib/dependabot/npm_and_yarn/update_checker/library_detector.rb', line 18

def library?
  return false unless package_json_may_be_for_library?

  npm_response_matches_package_json?
end