UNPKG

410 BJavaScriptView Raw
1var url = require("url")
2
3module.exports = toNerfDart
4
5/**
6 * Maps a URL to an identifier.
7 *
8 * Name courtesy schiffertronix media LLC, a New Jersey corporation
9 *
10 * @param {String} uri The URL to be nerfed.
11 *
12 * @returns {String} A nerfed URL.
13 */
14function toNerfDart(uri) {
15 var parsed = url.parse(uri)
16 parsed.pathname = "/"
17 delete parsed.protocol
18 delete parsed.auth
19
20 return url.format(parsed)
21}