aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/misc.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-03 10:12:36 +0100
committerChocobozzz <me@florianbigard.com>2018-01-03 10:38:19 +0100
commit47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (patch)
tree25e2836baf3dfce6f422192d98332db1bfe65890 /server/helpers/custom-validators/misc.ts
parentc5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (diff)
downloadPeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.gz
PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.tar.zst
PeerTube-47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04.zip
Add ability to disable video comments
Diffstat (limited to 'server/helpers/custom-validators/misc.ts')
-rw-r--r--server/helpers/custom-validators/misc.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts
index 160ec91f3..3903884ea 100644
--- a/server/helpers/custom-validators/misc.ts
+++ b/server/helpers/custom-validators/misc.ts
@@ -24,6 +24,10 @@ function isIdOrUUIDValid (value: string) {
24 return isIdValid(value) || isUUIDValid(value) 24 return isIdValid(value) || isUUIDValid(value)
25} 25}
26 26
27function isBooleanValid (value: string) {
28 return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value))
29}
30
27// --------------------------------------------------------------------------- 31// ---------------------------------------------------------------------------
28 32
29export { 33export {
@@ -32,5 +36,6 @@ export {
32 isIdValid, 36 isIdValid,
33 isUUIDValid, 37 isUUIDValid,
34 isIdOrUUIDValid, 38 isIdOrUUIDValid,
35 isDateValid 39 isDateValid,
40 isBooleanValid
36} 41}