]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/misc.ts
Fix server lint
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / misc.ts
index c80c861932716e395574c3d76736bbd6915c85fd..3dc5504e32545d611c3b9a1d325621cd6613c87a 100644 (file)
@@ -86,7 +86,7 @@ function isFileValid (options: {
 
   // The file exists
   const file = fileArray[0]
-  if (!file || !file.originalname) return false
+  if (!file?.originalname) return false
 
   // Check size
   if ((maxSize !== null) && file.size > maxSize) return false
@@ -136,12 +136,6 @@ function toValueOrNull (value: string) {
   return value
 }
 
-function toArray (value: any) {
-  if (value && isArray(value) === false) return [ value ]
-
-  return value
-}
-
 function toIntArray (value: any) {
   if (!value) return []
   if (isArray(value) === false) return [ validator.toInt(value) ]
@@ -170,7 +164,6 @@ export {
   isBooleanValid,
   toIntOrNull,
   areUUIDsValid,
-  toArray,
   toIntArray,
   isFileValid,
   checkMimetypeRegex