mirror of
https://github.com/CaramelFur/Picsur.git
synced 2025-11-12 23:05:39 +01:00
change validation to be stricter
This commit is contained in:
12
shared/src/util/validate.ts
Normal file
12
shared/src/util/validate.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { validate } from 'class-validator';
|
||||
|
||||
export const ValidateOptions = {
|
||||
disableErrorMessages: true,
|
||||
forbidNonWhitelisted: true,
|
||||
forbidUnknownValues: true,
|
||||
stopAtFirstError: true,
|
||||
whitelist: true,
|
||||
};
|
||||
|
||||
export const strictValidate = (object: object) =>
|
||||
validate(object, ValidateOptions);
|
||||
Reference in New Issue
Block a user