mirror of
https://github.com/pysunday/rs-reverse.git
synced 2025-04-12 03:46:56 +08:00
11 lines
164 B
JavaScript
11 lines
164 B
JavaScript
const URL = require('url').URL;
|
|
|
|
module.exports = function isValidUrl(url) {
|
|
try {
|
|
new URL(url);
|
|
return true;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|