mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Support only domain in url
This commit is contained in:
+2
-1
@@ -8,10 +8,11 @@ module.exports = class UrlType extends ArgumentType {
|
||||
}
|
||||
|
||||
validate(value) {
|
||||
return Boolean(validURL.isWebUri(value));
|
||||
return Boolean(validURL.isWebUri(value) || validURL.isWebUri(`http://${value}`));
|
||||
}
|
||||
|
||||
parse(value) {
|
||||
if (!validURL.isWebUri(value)) return new URL(`http://${value}`);
|
||||
return new URL(value);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user