Ajout filtres actions de défi

This commit is contained in:
2024-12-07 20:17:45 +01:00
parent c82d39c009
commit d902e05fdd
5 changed files with 43 additions and 5 deletions

View File

@ -0,0 +1,9 @@
import { Transform, TransformOptions } from "class-transformer"
export function BooleanTransform (options?: TransformOptions): PropertyDecorator {
return Transform(({ value }) => {
if (value.toString().toLowerCase() === "false")
return false
return Boolean(value)
}, options)
}