import { defaultMetadataStorage } from '../../default-storage.const' ; import { SanitationOptions } from '../../interfaces' ; import { SanitizeTypes } from '../../enums' ; /**
 * Convert the input to a boolean.
 * Everything except for '0', 'false' and '' returns true. In strict mode only '1' and 'true' return true.
 */ export function ToBoolean ( isStrict ? , annotationOptions = { } ) { return function ( target , propertyName ) { defaultMetadataStorage . addMetadata ( { type : SanitizeTypes . TO_BOOLEAN , target : target as Function , propertyName : propertyName , value1 : isStrict , each : annotationOptions . each , } , 'sanitation' ) ; } ; }