X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fsearch.ts;h=15b389a58e5969f36070c1cd59e859ec737c8d9f;hb=7cd4d2ba10106c10602c86f74f55743ded588896;hp=2fde391602014aa33ee46726e7dddfa7c7c041fc;hpb=d525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/search.ts b/server/helpers/custom-validators/search.ts index 2fde39160..15b389a58 100644 --- a/server/helpers/custom-validators/search.ts +++ b/server/helpers/custom-validators/search.ts @@ -11,9 +11,14 @@ function isStringArray (value: any) { return isArray(value) && value.every(v => typeof v === 'string') } +function isNSFWQueryValid (value: any) { + return value === 'true' || value === 'false' || value === 'both' +} + // --------------------------------------------------------------------------- export { isNumberArray, - isStringArray + isStringArray, + isNSFWQueryValid }