feat(nerf-dart): copy in nerf-dart module from npm
This commit is contained in:
parent
44a18fd5cf
commit
c59b5cac9c
14
src/lib/nerf-dart.js
Normal file
14
src/lib/nerf-dart.js
Normal file
@ -0,0 +1,14 @@
|
||||
// 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