Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Revert "Use fast-url-parser"
Browse files Browse the repository at this point in the history
This reverts commit 7b0f7d5.
  • Loading branch information
diracdeltas committed Jun 15, 2017
1 parent 6478bcd commit d329334
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
20 changes: 2 additions & 18 deletions app/common/urlParse.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const LRUCache = require('lru-cache')
const urlParse = require('fast-url-parser').parse
const urlParse = require('url').parse
const config = require('../../js/constants/config')
let cachedUrlParse = new LRUCache(config.cache.urlParse)

Expand All @@ -14,23 +14,7 @@ module.exports = (url, ...args) => {
return Object.assign({}, parsedUrl)
}

// In fast-url-parser href, port, prependSlash, protocol, and query
// are lazy so access them.
const raw = urlParse(url, ...args)
parsedUrl = {
auth: raw.auth,
hash: raw.hash,
host: raw.host,
hostname: raw.hostname,
href: raw.href,
path: raw.path,
pathname: raw.pathname,
port: raw.port,
protocol: raw.protocol,
query: raw.query,
search: raw.search,
slashes: raw.slashes
}
parsedUrl = urlParse(url, ...args)
cachedUrlParse.set(url, parsedUrl)
return parsedUrl
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"clipboard-copy": "^1.0.0",
"electron-localshortcut": "^0.6.0",
"electron-squirrel-startup": "brave/electron-squirrel-startup",
"fast-url-parser": "^1.1.3",
"file-loader": "^0.8.5",
"font-awesome": "^4.5.0",
"font-awesome-webpack": "0.0.4",
Expand Down

0 comments on commit d329334

Please sign in to comment.