"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/node_modules/hosted-git-info/git-host-info.js" (11 Apr 2017, 2828 Bytes) of package /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 'use strict'
    2 
    3 var gitHosts = module.exports = {
    4   github: {
    5     // First two are insecure and generally shouldn't be used any more, but
    6     // they are still supported.
    7     'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ],
    8     'domain': 'github.com',
    9     'treepath': 'tree',
   10     'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}',
   11     'bugstemplate': 'https://{domain}/{user}/{project}/issues',
   12     'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#committish}'
   13   },
   14   bitbucket: {
   15     'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
   16     'domain': 'bitbucket.org',
   17     'treepath': 'src'
   18   },
   19   gitlab: {
   20     'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
   21     'domain': 'gitlab.com',
   22     'treepath': 'tree',
   23     'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#README',
   24     'bugstemplate': 'https://{domain}/{user}/{project}/issues'
   25   },
   26   gist: {
   27     'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],
   28     'domain': 'gist.github.com',
   29     'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
   30     'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}',
   31     'bugstemplate': 'https://{domain}/{project}',
   32     'gittemplate': 'git://{domain}/{project}.git{#committish}',
   33     'sshtemplate': 'git@{domain}:/{project}.git{#committish}',
   34     'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#committish}',
   35     'browsetemplate': 'https://{domain}/{project}{/committish}',
   36     'docstemplate': 'https://{domain}/{project}{/committish}',
   37     'httpstemplate': 'git+https://{domain}/{project}.git{#committish}',
   38     'shortcuttemplate': '{type}:{project}{#committish}',
   39     'pathtemplate': '{project}{#committish}'
   40   }
   41 }
   42 
   43 var gitHostDefaults = {
   44   'sshtemplate': 'git@{domain}:{user}/{project}.git{#committish}',
   45   'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#committish}',
   46   'browsetemplate': 'https://{domain}/{user}/{project}{/tree/committish}',
   47   'docstemplate': 'https://{domain}/{user}/{project}{/tree/committish}#readme',
   48   'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#committish}',
   49   'filetemplate': 'https://{domain}/{user}/{project}/raw/{committish}/{path}',
   50   'shortcuttemplate': '{type}:{user}/{project}{#committish}',
   51   'pathtemplate': '{user}/{project}{#committish}',
   52   'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/
   53 }
   54 
   55 Object.keys(gitHosts).forEach(function (name) {
   56   Object.keys(gitHostDefaults).forEach(function (key) {
   57     if (gitHosts[name][key]) return
   58     gitHosts[name][key] = gitHostDefaults[key]
   59   })
   60   gitHosts[name].protocols_re = RegExp('^(' +
   61     gitHosts[name].protocols.map(function (protocol) {
   62       return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1')
   63     }).join('|') + '):$')
   64 })