import { ValueTransformer } from 'typeorm' ; import BN from 'bn.js' ; export const BNTransformer = { to : ( entityValue ) => entityValue ?. toString ( 10 ) , from : ( databaseValue ) : BN => new BN ( databaseValue ) } ;