Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
nerf-dart.js19 linesDownload Raw Back to lib
1const { URL } = require('node:url')
2
3/**
4 * Maps a URL to an identifier.
5 *
6 * Name courtesy schiffertronix media LLC, a New Jersey corporation
7 *
8 * @param {String} uri The URL to be nerfed.
9 *
10 * @returns {String} A nerfed URL.
11 */
12module.exports = (url) => {
13  const parsed = new URL(url)
14  const from = `${parsed.protocol}//${parsed.host}${parsed.pathname}`
15  const rel = new URL('.', from)
16  const res = `//${rel.host}${rel.pathname}`
17  return res
18}
19 
codekingpro/portable-devtools · Team Ai