"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/utils/package-id.js" (7 Feb 2017, 399 Bytes) of archive /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 var moduleName = require('./module-name.js')
    3 
    4 module.exports = function (tree) {
    5   var pkg = tree.package || tree
    6   // FIXME: Excluding the '@' here is cleaning up after the mess that
    7   // read-package-json makes. =(
    8   if (pkg._id && pkg._id !== '@') return pkg._id
    9   var name = moduleName(tree)
   10   if (pkg.version) {
   11     return name + '@' + pkg.version
   12   } else {
   13     return name
   14   }
   15 }