MCPcopy Create free account
hub / github.com/play-co/devkit / parseURL

Function parseURL

src/install/index.js:21–43  ·  view source on GitHub ↗
(url, protocol)

Source from the content-addressed store, hash-verified

19};
20
21function parseURL (url, protocol) {
22 // find version in url
23 var i = url.indexOf('#');
24 var version;
25 if (i >= 0) {
26 if (!version) {
27 version = url.substring(i + 1);
28 }
29 url = url.substring(0, i);
30 }
31
32 if (protocol === 'ssh') {
33 var match = url.match(/^https:\/\/(.*?)\/(.*)$/);
34 if (match) {
35 url = 'git@' + match[1] + ':' + match[2];
36 }
37 }
38
39 return {
40 url: url,
41 version: version
42 };
43}
44
45/**
46 * Figure out which version the user wishes to be installed.

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…