diff --git a/index.js b/index.js index f42dbe6..f41631e 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,6 @@ var parseSlug = require('parse-github-repo-url'); var normalizeData = require('normalize-package-data'); var hostedGitInfo = require('hosted-git-info'); var url = require('url'); -var typos = ['repostitory', 'repostitorys', 'repositories', 'repostitories', 'repositorys', 'repo', 'repos']; var gitAt = /^git@/; @@ -58,19 +57,11 @@ function unknownHostedInfo(repoUrl) { return new UnknownGitHost(); } -function getPkgRepo(pkgData, fixTypo) { +function getPkgRepo(pkgData) { try { pkgData = JSON.parse(pkgData); } catch (err) {} - if (fixTypo && !pkgData.repository) { - typos.forEach(function(val) { - if (pkgData[val]) { - pkgData.repository = pkgData[val]; - return false; - } - }); - } normalizeData(pkgData); var repo = pkgData.repository; diff --git a/test.js b/test.js index 3fbda0c..abc4050 100644 --- a/test.js +++ b/test.js @@ -128,17 +128,6 @@ it('should work with a json', function() { }); }); -it('should work if there is a typo', function() { - var repo = getPkgRepo({repo: 'a/b'}, true); - assertRepo(repo, { - browse: 'https://github.com/a/b', - domain: 'github.com', - type: 'github', - user: 'a', - project: 'b' - }); -}); - it('should error if cannot get repository', function() { assert.throws(function() { getPkgRepo({});