diff options
author | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:12:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-01-03 10:38:19 +0100 |
commit | 47564bbe2eeb2baae9b7e3f9b2b8d16522bc7e04 (patch) | |
tree | 25e2836baf3dfce6f422192d98332db1bfe65890 /server/helpers/custom-validators/misc.ts | |
parent | c5911fd347c76e8bdc05ea9f3ee9efed4a58c236 (diff) | |
download | PeerTube-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.ts | 7 |
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 | ||
27 | function isBooleanValid (value: string) { | ||
28 | return typeof value === 'boolean' || (typeof value === 'string' && validator.isBoolean(value)) | ||
29 | } | ||
30 | |||
27 | // --------------------------------------------------------------------------- | 31 | // --------------------------------------------------------------------------- |
28 | 32 | ||
29 | export { | 33 | export { |
@@ -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 | } |