Socket
Socket
Sign inDemoInstall

parse-repo

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-repo - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

index.js
var path = require('path');
function parseRemoteUri(remoteUri) {
var gitRemote = /^git@([^:]+):([^\.]+)(\.git)?$/,
httpRemote = /^(https?):\/\/([^@]+@)?([^\/]+)\/([^\.]+)(\.git)?$/;
var gitRemote = /^git@([^:]+):(.+\/.+)$/,
httpRemote = /^(https?):\/\/([^@]+@)?([^\/]+)\/(.+)$/;

@@ -10,3 +10,3 @@ var matches = null;

if (matches = gitRemote.exec(remoteUri)) {
var repository = matches[2],
var repository = matches[2].replace(/\.git$/, ''),
splitRepo = repository.split('/');

@@ -25,3 +25,3 @@

if (matches = httpRemote.exec(remoteUri)) {
var repository = matches[4],
var repository = matches[4].replace(/\.git$/, ''),
splitRepo = repository.split('/');

@@ -28,0 +28,0 @@

{
"name": "parse-repo",
"version": "1.0.1",
"version": "1.0.2",
"description": "Extract repository info from a git remote URI",

@@ -5,0 +5,0 @@ "author": "Diego Guerra <dgoguerra.or@gmail.com>",

@@ -32,2 +32,20 @@ var tape = require('tape'),

t.deepEqual(parseRepo('git@github.com:simshanith/pi.simloovoo.com.git'), {
remote: 'git@github.com:simshanith/pi.simloovoo.com.git',
protocol: 'git',
host: 'github.com',
repository: 'simshanith/pi.simloovoo.com',
owner: 'simshanith',
project: 'pi.simloovoo.com'
});
t.deepEqual(parseRepo('https://github.com/simshanith/pi.simloovoo.com'), {
remote: 'https://github.com/simshanith/pi.simloovoo.com',
protocol: 'https',
host: 'github.com',
repository: 'simshanith/pi.simloovoo.com',
owner: 'simshanith',
project: 'pi.simloovoo.com'
});
t.end();

@@ -34,0 +52,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc