parse-github-repo-url
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -5,3 +5,3 @@ var parse = require('url').parse | ||
// user/repo#version | ||
var m = /^([\w-]+)\/([\w-.]+)((?:#|@).+)?$/.exec(string) | ||
var m = /^([\w-.]+)\/([\w-.]+)((?:#|@).+)?$/.exec(string) | ||
if (m) return format(m) | ||
@@ -23,3 +23,3 @@ | ||
// https://www.npmjs.org/doc/json.html#Git-URLs-as-Dependencies | ||
var m = /^\/([\w-]+)\/([\w-.]+)$/.exec(path) | ||
var m = /^\/([\w-.]+)\/([\w-.]+)$/.exec(path) | ||
if (m) return m.slice(1, 3).concat((url.hash || '').slice(1)) | ||
@@ -29,3 +29,3 @@ | ||
// https://developer.github.com/v3/repos/contents/#get-archive-link | ||
var m = /^\/repos\/([\w-]+)\/([\w-.]+)\/(?:tarball|zipball)(\/.+)?$/.exec(path) | ||
var m = /^\/repos\/([\w-.]+)\/([\w-.]+)\/(?:tarball|zipball)(\/.+)?$/.exec(path) | ||
if (m) return format(m) | ||
@@ -35,3 +35,3 @@ | ||
// https://developer.github.com/v3/repos/contents/#response-4 | ||
var m = /^\/([\w-]+)\/([\w-.]+)\/(?:legacy\.(?:zip|tar\.gz))(\/.+)?$/.exec(path) | ||
var m = /^\/([\w-.]+)\/([\w-.]+)\/(?:legacy\.(?:zip|tar\.gz))(\/.+)?$/.exec(path) | ||
if (m) return format(m) | ||
@@ -38,0 +38,0 @@ |
{ | ||
"name": "parse-github-repo-url", | ||
"description": "Parse a GitHub URL for user/project@version", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
4481