"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/npm-registry-client/lib/tag.js" (8 Mar 2017, 690 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 module.exports = tag
    2 
    3 var assert = require('assert')
    4 
    5 function tag (uri, params, cb) {
    6   assert(typeof uri === 'string', 'must pass registry URI to tag')
    7   assert(params && typeof params === 'object', 'must pass params to tag')
    8   assert(typeof cb === 'function', 'must pass callback to tag')
    9 
   10   assert(typeof params.version === 'string', 'must pass version to tag')
   11   assert(typeof params.tag === 'string', 'must pass tag name to tag')
   12   assert(
   13     params.auth && typeof params.auth === 'object',
   14     'must pass auth to tag'
   15   )
   16 
   17   var options = {
   18     method: 'PUT',
   19     body: JSON.stringify(params.version),
   20     auth: params.auth
   21   }
   22   this.request(uri + '/' + params.tag, options, cb)
   23 }