UNPKG

sherry-utils

Version:
18 lines (14 loc) 433 B
const HTTP_RE = /^https?:\/\// const SSH_RE = /^git@([^:]*):(.*)\.git/ function isHttpRepoUrl(v) { return HTTP_RE.test(v) } function isSshRepoUrl(v) { return SSH_RE.test(v) } module.exports = v => isHttpRepoUrl(v) || isSshRepoUrl(v) module.exports.isHttpRepoUrl = isHttpRepoUrl module.exports.isSshRepoUrl = isSshRepoUrl module.exports.removePrefix = v => isHttpRepoUrl(v) ? v.replace(HTTP_RE, '') : v.replace(SSH_RE, '')