Socket
Socket
Sign inDemoInstall

github-url-to-object

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-url-to-object - npm Package Compare versions

Comparing version 1.3.3 to 1.4.0

2

bower.json
{
"name": "github-url-to-object",
"description": "Extract user, repo, and other interesting properties from GitHub URLs",
"version": "1.3.3",
"version": "1.4.0",
"license": "MIT",

@@ -6,0 +6,0 @@ "keywords": [

@@ -33,3 +33,3 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.gh=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

if (parsedURL.hostname != "github.com") return null
var parts = parsedURL.pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.]+)?(\/blob\/[\w-_\.]+)?/)
var parts = parsedURL.pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.\/]+)?(\/blob\/[\w-_\.\/]+)?/)
// ([\w-_\.]+)

@@ -41,5 +41,5 @@ if (!parts) return null

if (parts[3]) {
obj.branch = parts[3].replace(/^\/tree\//, "")
obj.branch = parts[3].replace(/^\/tree\//, "").match(/[\w-_]+\/{0,1}[\w-_]+/)[0]
} else if (parts[4]) {
obj.branch = parts[4].replace(/^\/blob\//, "")
obj.branch = parts[4].replace(/^\/blob\//, "").match(/[\w-_]+\/{0,1}[\w-_]+/)[0]
} else {

@@ -2179,2 +2179,2 @@ obj.branch = "master"

(1)
});
});

@@ -32,3 +32,3 @@ "use strict"

if (parsedURL.hostname != "github.com") return null
var parts = parsedURL.pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.]+)?(\/blob\/[\w-_\.]+)?/)
var parts = parsedURL.pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.\/]+)?(\/blob\/[\w-_\.\/]+)?/)
// ([\w-_\.]+)

@@ -40,5 +40,5 @@ if (!parts) return null

if (parts[3]) {
obj.branch = parts[3].replace(/^\/tree\//, "")
obj.branch = parts[3].replace(/^\/tree\//, "").match(/[\w-_]+\/{0,1}[\w-_]+/)[0]
} else if (parts[4]) {
obj.branch = parts[4].replace(/^\/blob\//, "")
obj.branch = parts[4].replace(/^\/blob\//, "").match(/[\w-_]+\/{0,1}[\w-_]+/)[0]
} else {

@@ -45,0 +45,0 @@ obj.branch = "master"

{
"name": "github-url-to-object",
"version": "1.3.3",
"version": "1.4.0",
"description": "Extract user, repo, and other interesting properties from GitHub URLs",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ # github-url-to-object [![Build Status](https://travis-ci.org/zeke/github-url-to-object.png?branch=master)](https://travis-ci.org/zeke/github-url-to-object)

Check out the [https://github-url-to-object.herokuapp.com](live demo).
Check out the demo at https://github-url-to-object.herokuapp.com.

@@ -11,0 +11,0 @@ ## Installation

@@ -122,2 +122,7 @@ var mocha = require("mocha")

it("resolves URLS for branches containing /", function() {
var obj = gh("https://github.com/zeke/outlet/tree/feature/other-branch")
assert.equal(obj.branch, 'feature/other-branch')
})
it("resolves blob-style URLS for branches other than master", function() {

@@ -124,0 +129,0 @@ var obj = gh("https://github.com/zeke/ord/blob/new-style/.gitignore")

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