Welcome to mirror list, hosted at ThFree Co, Russian Federation.

nerf-dart.js « config « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3b26a56c65f1ccd5d14326e59bed6986bba63f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var url = require("url")

module.exports = toNerfDart

/**
 * Maps a URL to an identifier.
 *
 * Name courtesy schiffertronix media LLC, a New Jersey corporation
 *
 * @param {String} uri The URL to be nerfed.
 *
 * @returns {String} A nerfed URL.
 */
function toNerfDart(uri) {
  var parsed = url.parse(uri)
  parsed.pathname = "/"
  delete parsed.protocol
  delete parsed.auth

  return url.format(parsed)
}