You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ghostfolio/libs/common/src/lib/class-transformer.ts

26 lines
436 B

import { Big } from 'big.js';
export function transformToMapOfBig({
value
}: {
value: { [key: string]: string };
}): {
[key: string]: Big;
} {
const mapOfBig: { [key: string]: Big } = {};
for (const key in value) {
mapOfBig[key] = new Big(value[key]);
}
return mapOfBig;
}
export function transformToBig({ value }: { value: string }): Big {
if (value === null) {
return null;
}
return new Big(value);
}