"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/lib/packages.js" (11 Apr 2017, 624 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 (function() {
    2   var url;
    3 
    4   url = require('url');
    5 
    6   module.exports = {
    7     getRepository: function(pack) {
    8       var name, owner, ref, ref1, ref2, repoPath, repository;
    9       if (pack == null) {
   10         pack = {};
   11       }
   12       if (repository = (ref = (ref1 = pack.repository) != null ? ref1.url : void 0) != null ? ref : pack.repository) {
   13         repoPath = url.parse(repository.replace(/\.git$/, '')).pathname;
   14         ref2 = repoPath.split('/').slice(-2), name = ref2[0], owner = ref2[1];
   15         if (name && owner) {
   16           return name + "/" + owner;
   17         }
   18       }
   19       return null;
   20     }
   21   };
   22 
   23 }).call(this);