File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
packages/fasset-indexer-core/src/orm/custom Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 11import { Type } from '@mikro-orm/core'
22
33
4- export class uint256 extends Type < bigint | null | undefined , string | null | undefined > {
4+ type Nullable < T > = T | null | undefined
55
6- convertToDatabaseValue ( value : bigint | null | undefined ) : string | null {
6+ export class uint256 extends Type < Nullable < bigint > , Nullable < string > > {
7+
8+ convertToDatabaseValue ( value : Nullable < bigint > ) : string | null {
79 if ( value === null || value === undefined ) {
8- return null ;
10+ return null
911 }
10- return value . toString ( ) ;
12+ return value . toString ( )
1113 }
1214
13- convertToJSValue ( value : string | null | undefined ) : bigint | null {
15+ convertToJSValue ( value : Nullable < string > ) : bigint | null {
1416 if ( value === null || value === undefined ) {
15- return null ;
17+ return null
1618 }
17- return BigInt ( value ) ;
19+ return BigInt ( value )
1820 }
1921
2022 getColumnType ( ) {
21- return `NUMERIC(78)` ; // or DECIMAL(78), depending on your DB
23+ return `NUMERIC(78)`
2224 }
2325}
2426
You can’t perform that action at this time.
0 commit comments