refactor(nerf-dart): use module from npm
This commit is contained in:
		
							parent
							
								
									b397ffe91f
								
							
						
					
					
						commit
						810b3533dd
					
				| @ -29,6 +29,7 @@ | ||||
|     "git-head": "^1.2.1", | ||||
|     "github": "^0.2.4", | ||||
|     "lodash": "^3.9.3", | ||||
|     "nerf-dart": "^1.0.0", | ||||
|     "nopt": "^3.0.3", | ||||
|     "npmconf": "^2.1.2", | ||||
|     "npmlog": "^1.2.1", | ||||
|  | ||||
| @ -71,7 +71,7 @@ npmconf.load({}, (err, conf) => { | ||||
|         if (!options.debug) process.exit(1) | ||||
|       } | ||||
| 
 | ||||
|       const nerfDart = require('./lib/nerf-dart')(npm.registry) | ||||
|       const nerfDart = require('nerf-dart')(npm.registry) | ||||
|       let wroteNpmRc = false | ||||
| 
 | ||||
|       if (env.NPM_TOKEN) { | ||||
|  | ||||
| @ -1,14 +0,0 @@ | ||||
| // borrowed from https://github.com/npm/npm/blob/master/lib/config/nerf-dart.js
 | ||||
| const url = require('url') | ||||
| 
 | ||||
| /* istanbul ignore next */ | ||||
| module.exports = function toNerfDart (uri) { | ||||
|   let parsed = url.parse(uri) | ||||
|   delete parsed.protocol | ||||
|   delete parsed.auth | ||||
|   delete parsed.query | ||||
|   delete parsed.search | ||||
|   delete parsed.hash | ||||
| 
 | ||||
|   return url.resolve(url.format(parsed), '.') | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user