Socket
Socket
Sign inDemoInstall

hosted-git-info

Package Overview
Dependencies
0
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.0 to 2.0.0

2

index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc