From caff12092edf8d8c4a9a7a1f3dba843be34c639b Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 6 Aug 2020 12:49:36 +0200 Subject: [PATCH] Upgrade to new @validatem/is-url API --- index.js | 4 ++-- package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 4bb7f51..ebbc651 100644 --- a/index.js +++ b/index.js @@ -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"); } } diff --git a/package.json b/package.json index a19101a..372587f 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/yarn.lock b/yarn.lock index f2b11ca..7519097 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"