import { TransformFnParams , TransformOptions } from 'class-transformer' ; todo see https import { defaultMetadataStorage } from 'class-transformer/cjs/storage' ; export function doSplit ( separator = ' ' ) { return ( { value } ) => { return typeof value === 'string' ? String ( value ) . split ( separator ) : [ ] ; } ; } export function Split ( separator , options = { } ) { const transformFn = doSplit ( separator ) ; return function ( target , propertyName ) : void { defaultMetadataStorage . addTransformMetadata ( { target : target . constructor , propertyName : propertyName as string , transformFn , options , } ) ; } ; }