Module: Dependabot::NpmAndYarn::Helpers

Defined in:
lib/dependabot/npm_and_yarn/helpers.rb

Class Method Summary collapse

Class Method Details

.npm_version(lockfile_content) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/dependabot/npm_and_yarn/helpers.rb', line 6

def self.npm_version(lockfile_content)
  return "npm7" unless lockfile_content
  return "npm7" if JSON.parse(lockfile_content)["lockfileVersion"] == 2

  "npm6"
rescue JSON::ParserError
  "npm6"
end