aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/utils/transformers/number_to_bigint.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-10 00:54:55 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2019-01-10 00:54:55 +0800
commitfb3605026ef63ef6897010a52bf3f4c116cdf271 (patch)
treeaf3887e5f785e049daeaf795e0f3e4a9ad370d93 /packages/pipeline/src/utils/transformers/number_to_bigint.ts
parent76dde294f10bb3d5c1074cd6599668bcb1cdd8ec (diff)
parent5b8c9122a292f6558c45440b053ceae52d36d495 (diff)
downloaddexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.gz
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.bz2
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.lz
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.xz
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.tar.zst
dexon-0x-contracts-fb3605026ef63ef6897010a52bf3f4c116cdf271.zip
Merge branch 'development' into feature/instant/tell-amount-available
Diffstat (limited to 'packages/pipeline/src/utils/transformers/number_to_bigint.ts')
-rw-r--r--packages/pipeline/src/utils/transformers/number_to_bigint.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/pipeline/src/utils/transformers/number_to_bigint.ts b/packages/pipeline/src/utils/transformers/number_to_bigint.ts
index 85560c1f0..9736d7c18 100644
--- a/packages/pipeline/src/utils/transformers/number_to_bigint.ts
+++ b/packages/pipeline/src/utils/transformers/number_to_bigint.ts
@@ -9,8 +9,12 @@ const decimalRadix = 10;
// https://github.com/typeorm/typeorm/issues/2400 for more information.
export class NumberToBigIntTransformer implements ValueTransformer {
// tslint:disable-next-line:prefer-function-over-method
- public to(value: number): string {
- return value.toString();
+ public to(value: number): string | null {
+ if (value === null || value === undefined) {
+ return null;
+ } else {
+ return value.toString();
+ }
}
// tslint:disable-next-line:prefer-function-over-method