diff options
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/logs.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/logs.ts b/server/helpers/custom-validators/logs.ts new file mode 100644 index 000000000..30d0ce262 --- /dev/null +++ b/server/helpers/custom-validators/logs.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import { exists } from './misc' | ||
2 | import { LogLevel } from '../../../shared/models/server/log-level.type' | ||
3 | |||
4 | const logLevels: LogLevel[] = [ 'debug', 'info', 'warn', 'error' ] | ||
5 | |||
6 | function isValidLogLevel (value: any) { | ||
7 | return exists(value) && logLevels.indexOf(value) !== -1 | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | isValidLogLevel | ||
14 | } | ||