]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/search.ts
Translated using Weblate (Korean)
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / search.ts
index 2fde391602014aa33ee46726e7dddfa7c7c041fc..bb17134c391926a14f775d88a0a542df34b7d5f5 100644 (file)
@@ -1,6 +1,4 @@
-import * as validator from 'validator'
-import 'express-validator'
-
+import validator from 'validator'
 import { isArray } from './misc'
 
 function isNumberArray (value: any) {
@@ -11,9 +9,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
 }