We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
url
1 parent fc48e17 commit 5a2b44dCopy full SHA for 5a2b44d
1 file changed
lib/parse-url.js
@@ -1,13 +1,11 @@
1
-const url = require('url')
2
-
3
const lastIndexOfBefore = (str, char, beforeChar) => {
4
const startPosition = str.indexOf(beforeChar)
5
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)
6
}
7
8
const safeUrl = (u) => {
9
try {
10
- return new url.URL(u)
+ return new URL(u)
11
} catch {
12
// this fn should never throw
13
0 commit comments