hosted-git-info
Advanced tools
Comparing version 1.6.0 to 2.0.0
@@ -219,3 +219,3 @@ 'use strict' | ||
GitHost.prototype.getDefaultType = function () { | ||
GitHost.prototype.getDefaultRepresentation = function () { | ||
return this.default | ||
@@ -222,0 +222,0 @@ } |
{ | ||
"name": "hosted-git-info", | ||
"version": "1.6.0", | ||
"version": "2.0.0", | ||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -78,3 +78,3 @@ # hosted-git-info | ||
* info.getDefaultType() | ||
* info.getDefaultRepresentation() | ||
@@ -86,3 +86,3 @@ Returns the default output type. The default output type is based on the | ||
Uses the getDefaultType to call one of the other methods to get a URL for | ||
Uses the getDefaultRepresentation to call one of the other methods to get a URL for | ||
this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give | ||
@@ -89,0 +89,0 @@ you a normalized version of the URL that still uses the same protocol. |
@@ -7,10 +7,10 @@ 'use strict' | ||
t.is(HostedGit.fromUrl('https://google.com'), undefined, 'null on failure') | ||
t.is(HostedGit.fromUrl('https://github.com/abc/def').getDefaultType(), 'https', 'match https urls') | ||
t.is(HostedGit.fromUrl('ssh://git@github.com/abc/def').getDefaultType(), 'sshurl', 'match ssh urls') | ||
t.is(HostedGit.fromUrl('git+ssh://git@github.com/abc/def').getDefaultType(), 'sshurl', 'match git+ssh urls') | ||
t.is(HostedGit.fromUrl('git+https://github.com/abc/def').getDefaultType(), 'https', 'match git+https urls') | ||
t.is(HostedGit.fromUrl('git@github.com:abc/def').getDefaultType(), 'sshurl', 'match ssh connect strings') | ||
t.is(HostedGit.fromUrl('git://github.com/abc/def').getDefaultType(), 'git', 'match git urls') | ||
t.is(HostedGit.fromUrl('github:abc/def').getDefaultType(), 'shortcut', 'match shortcuts') | ||
t.is(HostedGit.fromUrl('https://github.com/abc/def').getDefaultRepresentation(), 'https', 'match https urls') | ||
t.is(HostedGit.fromUrl('ssh://git@github.com/abc/def').getDefaultRepresentation(), 'sshurl', 'match ssh urls') | ||
t.is(HostedGit.fromUrl('git+ssh://git@github.com/abc/def').getDefaultRepresentation(), 'sshurl', 'match git+ssh urls') | ||
t.is(HostedGit.fromUrl('git+https://github.com/abc/def').getDefaultRepresentation(), 'https', 'match git+https urls') | ||
t.is(HostedGit.fromUrl('git@github.com:abc/def').getDefaultRepresentation(), 'sshurl', 'match ssh connect strings') | ||
t.is(HostedGit.fromUrl('git://github.com/abc/def').getDefaultRepresentation(), 'git', 'match git urls') | ||
t.is(HostedGit.fromUrl('github:abc/def').getDefaultRepresentation(), 'shortcut', 'match shortcuts') | ||
t.end() | ||
}) |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22749
0