Wartość domyślna klasy-transformatora

import { Transform, Expose } from 'class-transformer'
import { cloneDeep } from 'lodash'

export function Default(defaultValue: unknown): PropertyDecorator {
  return Transform((value: unknown) => value ?? cloneDeep(defaultValue))
}
                   
class A {
  @Expose()
  @Default('123')
  a: string
}
Jens