"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm/lib/utils/get-publish-config.js" (8 Mar 2017, 807 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 var Conf = require('../config/core.js').Conf
    2 var CachingRegClient = require('../cache/caching-client.js')
    3 var log = require('npmlog')
    4 
    5 module.exports = getPublishConfig
    6 
    7 function getPublishConfig (publishConfig, defaultConfig, defaultClient) {
    8   var config = defaultConfig
    9   var client = defaultClient
   10   log.verbose('getPublishConfig', publishConfig)
   11   if (publishConfig) {
   12     config = new Conf(defaultConfig)
   13     config.save = defaultConfig.save.bind(defaultConfig)
   14 
   15     // don't modify the actual publishConfig object, in case we have
   16     // to set a login token or some other data.
   17     config.unshift(Object.keys(publishConfig).reduce(function (s, k) {
   18       s[k] = publishConfig[k]
   19       return s
   20     }, {}))
   21     client = new CachingRegClient(config)
   22   }
   23 
   24   return { config: config, client: client }
   25 }