Describe the bug
A clear and concise description of what the bug is.
The isURL method always returns false, regardless what the input string is. Also ignores the config object.
Examples
function checkIfUrlIsValid(url) {
isURL(url)
}
checkIfUrlIsValid('www.index.hu') --> false
checkIfUrlIsValid('index.hu') --> false
checkIfUrlIsValid('https://www.index.hu') --> false
checkIfUrlIsValid('google.com') --> false
Additional context
Validator.js version: 13.1.1
Node.js version: node/12.8.1
OS platform: macOS
@zilahir, I tried this on MacOS, node/12.8.1 and validator.js 13.1.1 but it works fine.
var validator = require('validator')
function checkIfUrlIsValid(url) {
return validator.isURL(url)
}
console.log(checkIfUrlIsValid('www.index.hu')) // true
console.log(checkIfUrlIsValid('index.hu')) // true
console.log(checkIfUrlIsValid('https://www.index.hu')) // true
console.log(checkIfUrlIsValid('google.com')) // true
I will need to do more investigations.
@ezkemboi hmmm interesting. i will create a demo project soon! thanks for the reply.
It should not, google.com, index.hu and www.index.hu are all domain's names not URIs based on RFC-3986.
I was facing the same issues with your module and valid-url so I decided to build a module as reliable as possible strictly based on RFC-3986: https://github.com/adrienv1520/node-uri
You can:
I hope it could help.
Most helpful comment
It should not,
google.com,index.huandwww.index.huare all domain's names not URIs based on RFC-3986.I was facing the same issues with your module and
valid-urlso I decided to build a module as reliable as possible strictly based on RFC-3986: https://github.com/adrienv1520/node-uriYou can:
I hope it could help.