+9
-2
| 1.0.3 / 2023-06-17 | ||
| 2.0.0 / 2023-06-17 | ||
| ================== | ||
| **features** | ||
| * [[`df78450`](http://github.com/repo-utils/giturl/commit/df784508c213ff7caccf3c6ea99c8ea979e3dcc3)] - feat: drop Node.js < 14 support (fengmk2 <<fengmk2@gmail.com>>) | ||
| 1.0.2 / 2023-06-15 | ||
| ================== | ||
| **fixes** | ||
| * [[`f399d2d`](http://github.com/repo-utils/giturl/commit/f399d2df3ef9d0d20080d04e9f0945319c5957dc)] - fix: revert 1.0.2 (fengmk2 <<fengmk2@gmail.com>>) | ||
| * [[`3ba325d`](http://github.com/repo-utils/giturl/commit/3ba325d7cd56ab0a3e037edf2e91398ccbfc996b)] - fix: use origin http protocol (#16) (Haoliang Gao <<sakura9515@gmail.com>>) | ||
| **others** | ||
| * [[`89c8cba`](http://github.com/repo-utils/giturl/commit/89c8cba9fbd98e73d9d889700a5e5e4c5ae56b78)] - test: run test on github ci (#17) (fengmk2 <<fengmk2@gmail.com>>) | ||
| * [[`be30f17`](http://github.com/repo-utils/giturl/commit/be30f17bf780492b75502d470f440d1de2a9e28f)] - update https://registry.npm.taobao.org to https://registry.npmmirror.com (#15) (NPM Mirror Bot <<99484857+npmmirror@users.noreply.github.com>>) | ||
@@ -10,0 +17,0 @@ |
+17
-16
@@ -1,17 +0,3 @@ | ||
| /**! | ||
| * giturl - lib/giturl.js | ||
| * | ||
| * Copyright(c) 2014 | ||
| * MIT Licensed | ||
| * | ||
| * Authors: | ||
| * fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com) | ||
| */ | ||
| "use strict"; | ||
| /** | ||
| * Module dependencies. | ||
| */ | ||
| // host[:/]n1/n2 | ||
@@ -32,2 +18,9 @@ var RE = /^([^:\/]+)[:\/](.+)$/i; | ||
| var url = sourceURL; | ||
| var originProtocol; | ||
| try { | ||
| var uo = new URL(url); | ||
| originProtocol = uo.protocol; | ||
| } catch (_) {} | ||
| if (url.indexOf('@') >= 0) { | ||
@@ -44,8 +37,16 @@ url = url.replace(/^[^@]+@/, ''); // `git@`` || `https://jpillora@` => "" | ||
| var host = item[1]; | ||
| var protocol = HTTPS_HOSTS[host] ? 'https' : 'http'; | ||
| var protocol; | ||
| if (HTTPS_HOSTS[host]) { | ||
| protocol = 'https:'; | ||
| } else if ([ 'https:', 'http:' ].includes(originProtocol)) { | ||
| protocol = originProtocol; | ||
| } else { | ||
| protocol = 'http:'; | ||
| } | ||
| // p1/p2/.../pn[.xxx] | ||
| var isContainGit = /\.git$/.test(sourceURL); | ||
| var url = isContainGit ? item[2] : item[2].split('/', 2).join('/'); | ||
| return protocol + '://' + host + '/' + url; | ||
| return protocol + '//' + host + '/' + url; | ||
| }; |
+16
-25
| { | ||
| "name": "giturl", | ||
| "version": "1.0.3", | ||
| "version": "2.0.0", | ||
| "description": "Transfer git url to web url", | ||
| "main": "index.js", | ||
| "files": [ | ||
| "lib", | ||
| "index.js" | ||
| ], | ||
| "scripts": { | ||
| "test": "mocha test/*.test.js" | ||
| "test": "mocha test/*.test.js", | ||
| "ci": "c8 -r text -r lcov npm test", | ||
| "contributor": "git-contributor" | ||
| }, | ||
| "config": { | ||
| "blanket": { | ||
| "pattern": "giturl/lib" | ||
| }, | ||
| "travis-cov": { | ||
| "threshold": 100 | ||
| } | ||
| }, | ||
| "dependencies": {}, | ||
| "devDependencies": { | ||
| "autod": "*", | ||
| "blanket": "*", | ||
| "contributors": "*", | ||
| "cov": "*", | ||
| "coveralls": "*", | ||
| "c8": "^8.0.0", | ||
| "git-contributor": "^2.1.5", | ||
| "jshint": "*", | ||
| "mocha": "2", | ||
| "mocha-lcov-reporter": "*", | ||
| "should": "3.3.1", | ||
| "travis-cov": "*" | ||
| "mocha": "^10.2.0", | ||
| "should": "3.3.1" | ||
| }, | ||
@@ -33,8 +26,6 @@ "homepage": "https://github.com/repo-utils/giturl", | ||
| "type": "git", | ||
| "url": "git://github.com/repo-utils/giturl.git", | ||
| "web": "https://github.com/repo-utils/giturl" | ||
| "url": "git://github.com/repo-utils/giturl.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/repo-utils/giturl/issues", | ||
| "email": "fengmk2@gmail.com" | ||
| "url": "https://github.com/repo-utils/giturl/issues" | ||
| }, | ||
@@ -49,6 +40,6 @@ "keywords": [ | ||
| "engines": { | ||
| "node": ">= 0.10.0" | ||
| "node": ">= 14.17.0" | ||
| }, | ||
| "author": "fengmk2 <fengmk2@gmail.com> (http://fengmk2.github.com)", | ||
| "author": "fengmk2 <fengmk2@gmail.com> (http://github.com/fengmk2)", | ||
| "license": "MIT" | ||
| } |
+16
-9
@@ -1,10 +0,5 @@ | ||
| giturl | ||
| ======= | ||
| # giturl | ||
| [](http://travis-ci.org/repo-utils/giturl) | ||
| [](https://github.com/repo-utils/giturl/actions/workflows/nodejs.yml) | ||
| [](https://coveralls.io/r/repo-utils/giturl) | ||
| [](https://gemnasium.com/repo-utils/giturl) | ||
| [](https://nodei.co/npm/giturl/) | ||
@@ -19,3 +14,3 @@ | ||
| ```bash | ||
| $ npm install giturl | ||
| npm install giturl | ||
| ``` | ||
@@ -57,3 +52,3 @@ | ||
| Copyright (c) 2014 fengmk2 <fengmk2@gmail.com> and other contributors | ||
| Copyright (c) 2014 fengmk2 <<fengmk2@gmail.com>> and other contributors | ||
@@ -78,1 +73,13 @@ Permission is hereby granted, free of charge, to any person obtaining | ||
| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| <!-- GITCONTRIBUTOR_START --> | ||
| ## Contributors | ||
| |[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/99484857?v=4" width="100px;"/><br/><sub><b>npmmirror</b></sub>](https://github.com/npmmirror)<br/>| | ||
| | :---: | :---: | :---: | | ||
| This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Thu Jun 15 2023 08:58:20 GMT+0800`. | ||
| <!-- GITCONTRIBUTOR_END --> |
-5
| # Ordered by date of first contribution. | ||
| fengmk2 <fengmk2@gmail.com> (https://github.com/fengmk2) | ||
| popomore <sakura9515@gmail.com> (https://github.com/popomore) | ||
7775
9.11%5
-50%83
9.21%6
-14.29%