aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils/transformers
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-12-05 12:04:08 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:06:35 +0800
commit6742142ca567d49e2e67d0ab0f5fc55b1351ec7c (patch)
treee2d382e9bc652b67f1eef65d0f23a6086085cbfb /packages/pipeline/src/utils/transformers
parentb7e06a2282bc8bd666a58f1458d37e12bd9e855d (diff)
downloaddexon-0x-contracts-6742142ca567d49e2e67d0ab0f5fc55b1351ec7c.tar.gz
dexon-0x-contracts-6742142ca567d49e2e67d0ab0f5fc55b1351ec7c.tar.zst
dexon-0x-contracts-6742142ca567d49e2e67d0ab0f5fc55b1351ec7c.zip
Address PR feedback
Diffstat (limited to 'packages/pipeline/src/utils/transformers')
-rw-r--r--packages/pipeline/src/utils/transformers/big_number.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/pipeline/src/utils/transformers/big_number.ts b/packages/pipeline/src/utils/transformers/big_number.ts
index a0471a5e3..5f2e4d565 100644
--- a/packages/pipeline/src/utils/transformers/big_number.ts
+++ b/packages/pipeline/src/utils/transformers/big_number.ts
@@ -3,13 +3,13 @@ import { ValueTransformer } from 'typeorm/decorator/options/ValueTransformer';
export class BigNumberTransformer implements ValueTransformer {
// tslint:disable-next-line:prefer-function-over-method
- public to(value: BigNumber): string {
- return value.toString();
+ public to(value: BigNumber | null): string | null {
+ return value === null ? null : value.toString();
}
// tslint:disable-next-line:prefer-function-over-method
- public from(value: string): BigNumber {
- return new BigNumber(value);
+ public from(value: string | null): BigNumber | null {
+ return value === null ? null : new BigNumber(value);
}
}