dependabot-npm_and_yarn 0.154.2 → 0.155.1

Sign up to get free protection for your applications and to get access to all the features.
data/helpers/package.json CHANGED
@@ -10,15 +10,15 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@dependabot/yarn-lib": "^1.21.1",
13
- "@npmcli/arborist": "^2.6.2",
13
+ "@npmcli/arborist": "^2.6.3",
14
14
  "detect-indent": "^6.1.0",
15
15
  "npm": "6.14.13",
16
16
  "semver": "^7.3.4"
17
17
  },
18
18
  "devDependencies": {
19
- "eslint": "^7.28.0",
19
+ "eslint": "^7.29.0",
20
20
  "eslint-config-prettier": "^8.3.0",
21
- "jest": "^27.0.4",
21
+ "jest": "^27.0.5",
22
22
  "prettier": "^2.3.1",
23
23
  "rimraf": "^3.0.2"
24
24
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  require "excon"
4
4
  require "dependabot/npm_and_yarn/update_checker"
5
+ require "dependabot/update_checkers/version_filters"
5
6
  require "dependabot/npm_and_yarn/update_checker/registry_finder"
6
7
  require "dependabot/npm_and_yarn/version"
7
8
  require "dependabot/npm_and_yarn/requirement"
@@ -58,15 +59,17 @@ module Dependabot
58
59
  def lowest_security_fix_version
59
60
  return unless valid_npm_details?
60
61
 
61
- versions_array =
62
+ secure_versions =
62
63
  if specified_dist_tag_requirement?
63
64
  [version_from_dist_tags].compact
64
65
  else possible_versions(filter_ignored: false)
65
66
  end
66
67
 
67
- secure_versions = filter_vulnerable_versions(versions_array)
68
+ secure_versions = Dependabot::UpdateCheckers::VersionFilters.filter_vulnerable_versions(secure_versions,
69
+ security_advisories)
68
70
  secure_versions = filter_ignored_versions(secure_versions)
69
71
  secure_versions = filter_lower_versions(secure_versions)
72
+
70
73
  secure_versions.reverse.find { |version| !yanked?(version) }
71
74
  rescue Excon::Error::Socket, Excon::Error::Timeout
72
75
  raise if dependency_registry == "registry.npmjs.org"
@@ -125,18 +128,6 @@ module Dependabot
125
128
  select { |v| reqs.all? { |r| r.any? { |o| o.satisfied_by?(v) } } }
126
129
  end
127
130
 
128
- def filter_vulnerable_versions(versions_array)
129
- updated_versions_array = versions_array
130
-
131
- security_advisories.each do |advisory|
132
- updated_versions_array =
133
- updated_versions_array.
134
- reject { |v| advisory.vulnerable?(v) }
135
- end
136
-
137
- updated_versions_array
138
- end
139
-
140
131
  def filter_lower_versions(versions_array)
141
132
  return versions_array unless dependency.version && version_class.correct?(dependency.version)
142
133
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-npm_and_yarn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.154.2
4
+ version: 0.155.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.154.2
19
+ version: 0.155.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.154.2
26
+ version: 0.155.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement