Upgrade to new @validatem/is-url API

master
Sven Slootweg 4 years ago
parent 8b93c10eca
commit caff12092e

@ -6,9 +6,9 @@ const wrapError = require("@validatem/wrap-error");
const ValidationError = require("@validatem/error");
module.exports = wrapError("modular-matrix.is-mxc", "Must be a valid MXC URL", ignoreResult([
isURL([ "mxc" ]),
isURL([ "mxc://" ]),
function (value) {
if (value.slashes !== true || value.hostname == null || value.pathname == null) {
if (value.hostname == null || value.pathname == null) {
return new ValidationError("Must be a valid MXC URL");
}
}

@ -13,7 +13,7 @@
"dependencies": {
"@validatem/error": "^1.1.0",
"@validatem/ignore-result": "^0.1.1",
"@validatem/is-url": "^0.1.1",
"@validatem/is-url": "^0.2.0",
"@validatem/wrap-error": "^0.2.0"
},
"devDependencies": {

@ -97,10 +97,10 @@
"@validatem/error" "^1.0.0"
is-string "^1.0.5"
"@validatem/is-url@^0.1.1":
version "0.1.1"
resolved "https://registry.yarnpkg.com/@validatem/is-url/-/is-url-0.1.1.tgz#80e4794da8bbcd776f3aae6edaf7c98df1539c91"
integrity sha512-PGgt70ZiAdFOB7r2Vb2n2/aZ7gCexLs1FZar9vfc/lTWEiNrRBelA7hDL+HbUQquRM8h3SGIOK0aPoTbMmgOgQ==
"@validatem/is-url@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@validatem/is-url/-/is-url-0.2.0.tgz#b51f5de0c3fde91a68fc90b6b69c34e9bdbd82a2"
integrity sha512-ZzP3e6a/m8yKTLIqKF3MRAGqcPxx0UhOCdItbLHlyJZZiJUalCBfBBSzVq0mnV9jXuTaE90kVRzP3qByFXkmBw==
dependencies:
"@validatem/error" "^1.0.0"
"@validatem/is-string" "^0.1.1"

Loading…
Cancel
Save