aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/misc.ts
diff options
context:
space:
mode:
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}