]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/misc.ts
Check live duration and size
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / misc.ts
index cf32201c411a6532e6c002c88282b699657ddee7..61c03f0c978fa947e6494452333fa3496aaade56 100644 (file)
@@ -45,6 +45,10 @@ function isBooleanValid (value: any) {
   return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value))
 }
 
+function isIntOrNull (value: any) {
+  return value === null || validator.isInt('' + value)
+}
+
 function toIntOrNull (value: string) {
   const v = toValueOrNull(value)
 
@@ -116,6 +120,7 @@ export {
   isArrayOf,
   isNotEmptyIntArray,
   isArray,
+  isIntOrNull,
   isIdValid,
   isSafePath,
   isUUIDValid,