Packages

A web application in pursuit of meaning in life.

Retired package: Complete rewrite, scratch old versions

Current section

Files

Jump to
udia assets node_modules init-skeleton lib clean-url.js
Raw

assets/node_modules/init-skeleton/lib/clean-url.js

'use strict';
const hostedGitInfo = require('hosted-git-info');
const normalizeGitUrl = require('normalize-git-url');
const loggy = require('loggy');
const cleanURL = address => {
let git = address.replace(/^gh:/, 'github:');
const hosted = hostedGitInfo.fromUrl(git);
if (hosted) {
git = hosted.git();
} else {
loggy.warn(`Couldn't interpret "${git}" as a hosted git url`);
}
return normalizeGitUrl(git).url;
};
module.exports = cleanURL;