Class: Dependabot::FileUpdaters::JavaScript::NpmAndYarn::PackageJsonUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/dependabot/file_updaters/java_script/npm_and_yarn/package_json_updater.rb

Instance Method Summary collapse

Constructor Details

#initialize(package_json:, dependencies:) ⇒ PackageJsonUpdater

Returns a new instance of PackageJsonUpdater.



10
11
12
13
# File 'lib/dependabot/file_updaters/java_script/npm_and_yarn/package_json_updater.rb', line 10

def initialize(package_json:, dependencies:)
  @package_json = package_json
  @dependencies = dependencies
end

Instance Method Details

#updated_package_jsonObject



15
16
17
18
19
# File 'lib/dependabot/file_updaters/java_script/npm_and_yarn/package_json_updater.rb', line 15

def updated_package_json
  updated_file = package_json.dup
  updated_file.content = updated_package_json_content
  updated_file
end