hosted-git-info
Advanced tools
Comparing version 2.6.1 to 2.7.0
@@ -13,3 +13,3 @@ 'use strict' | ||
'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}', | ||
'tarballtemplate': 'https://{domain}/{user}/{project}/archive/{committish}.tar.gz' | ||
'tarballtemplate': 'https://codeload.{domain}/{user}/{project}/tar.gz/{committish}' | ||
}, | ||
@@ -26,3 +26,2 @@ bitbucket: { | ||
'treepath': 'tree', | ||
'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README', | ||
'bugstemplate': 'https://{domain}/{user}/{project}/issues', | ||
@@ -29,0 +28,0 @@ 'tarballtemplate': 'https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}' |
'use strict' | ||
var gitHosts = require('./git-host-info.js') | ||
/* eslint-disable node/no-deprecated-api */ | ||
var extend = Object.assign || require('util')._extend | ||
@@ -53,4 +54,4 @@ | ||
vars['/tree/committish'] = vars.committish | ||
? '/' + vars.treepath + '/' + vars.committish | ||
: '' | ||
? '/' + vars.treepath + '/' + vars.committish | ||
: '' | ||
vars['/committish'] = vars.committish ? '/' + vars.committish : '' | ||
@@ -57,0 +58,0 @@ vars.committish = vars.committish || 'master' |
@@ -61,3 +61,3 @@ 'use strict' | ||
} else { | ||
if (parsed.host !== gitHostInfo.domain) return | ||
if (parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return | ||
if (!gitHostInfo.protocols_re.test(parsed.protocol)) return | ||
@@ -64,0 +64,0 @@ if (!parsed.path) return |
{ | ||
"name": "hosted-git-info", | ||
"version": "2.6.1", | ||
"version": "2.7.0", | ||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", | ||
@@ -23,7 +23,12 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "standard && tap -J --coverage test/*.js" | ||
"prerelease": "npm t", | ||
"postrelease": "npm publish && git push --follow-tags", | ||
"pretest": "standard", | ||
"release": "standard-version -s", | ||
"test": "tap -J --nyc-arg=--all --coverage test" | ||
}, | ||
"devDependencies": { | ||
"standard": "^9.0.2", | ||
"tap": "^10.3.0" | ||
"standard": "^11.0.1", | ||
"standard-version": "^4.3.0", | ||
"tap": "^12.0.1" | ||
}, | ||
@@ -30,0 +35,0 @@ "files": [ |
19123
7
3