git-url-parse
Advanced tools
Comparing version 6.0.3 to 6.0.4
@@ -94,3 +94,7 @@ "use strict"; | ||
case "https": | ||
return type + "://" + obj.resource + "/" + obj.full_name; | ||
var token = ""; | ||
if (obj.token) { | ||
token = buildToken(obj); | ||
} | ||
return type + "://" + token + obj.resource + "/" + obj.full_name; | ||
default: | ||
@@ -101,2 +105,20 @@ return obj.href; | ||
/*! | ||
* buildToken | ||
* Builds OAuth token prefix (helper function) | ||
* | ||
* @name buildToken | ||
* @function | ||
* @param {GitUrl} obj The parsed Git url object. | ||
* @return {String} token prefix | ||
*/ | ||
function buildToken(obj) { | ||
switch (obj.source) { | ||
case "bitbucket.org": | ||
return "x-token-auth:" + obj.token + "@"; | ||
default: | ||
return obj.token + "@"; | ||
} | ||
} | ||
module.exports = gitUrlParse; |
{ | ||
"name": "git-url-parse", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"description": "A high level git url parser for common git providers.", | ||
"main": "dist/index.js", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "node test", | ||
"dist": "dist-it lib/index.js index.js" | ||
"test": "node test" | ||
}, | ||
@@ -26,3 +25,2 @@ "repository": { | ||
"blah": { | ||
"main": "lib/index.js", | ||
"h_img": "http://i.imgur.com/HlfMsVf.png" | ||
@@ -38,3 +36,5 @@ }, | ||
"devDependencies": { | ||
"browserify": "^13.0.1", | ||
"dist-it": "^2.0.0", | ||
"namy": "^1.2.3", | ||
"tester": "^1.3.1" | ||
@@ -54,2 +54,2 @@ }, | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
0
5878
4
3
108