Skip to content

Commit

Permalink
Merge pull request #4840 from ianlyons/patch-1
Browse files Browse the repository at this point in the history
Remove unnecessary get_directory special cases for npm_and_yarn
  • Loading branch information
jurre authored Apr 4, 2022
2 parents 7827bd6 + 3a568fe commit a0d4a26
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions npm_and_yarn/lib/dependabot/npm_and_yarn/metadata_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,6 @@ def get_url(details)
end

def get_directory(details)
source_from_url = Source.from_url(get_url(details))
# Special case Gatsby, which specifies directories in URLs.
# This can be removed once this PR is merged:
# https://github.com/gatsbyjs/gatsby/pull/11145
if source_from_url.repo == "gatsbyjs/gatsby" &&
get_url(details).match?(%r{tree\/master\/.})
return get_url(details).split("tree/master/").last.split("#").first
end

# Special case DefinitelyTyped, which has predictable URLs.
# This can be removed once this PR is merged:
# https://github.com/Microsoft/types-publisher/pull/578
return dependency.name.gsub(/^@/, "") if source_from_url.repo == "DefinitelyTyped/DefinitelyTyped"

# Only return a directory if it is explicitly specified
return unless details.is_a?(Hash)

Expand Down

0 comments on commit a0d4a26

Please sign in to comment.