diff --git a/packages/util/src/bn/toU8a.ts b/packages/util/src/bn/toU8a.ts index ed67a3ca4..062b1e92d 100644 --- a/packages/util/src/bn/toU8a.ts +++ b/packages/util/src/bn/toU8a.ts @@ -22,7 +22,7 @@ const DEFAULT_OPTS: NumberOptions = { bitLength: -1, isLe: true, isNegative: fal * bnToU8a(new BN(0x1234)); // => [0x12, 0x34] * ``` */ -function bnToU8a (value?: ExtToBn | BN | bigint | number | null, { bitLength = -1, isLe = true, isNegative = false } = DEFAULT_OPTS): Uint8Array { +export function bnToU8a (value?: ExtToBn | BN | bigint | number | null, { bitLength = -1, isLe = true, isNegative = false } = DEFAULT_OPTS): Uint8Array { const valueBn = bnToBn(value); const byteLength = bitLength === -1 ? Math.ceil(valueBn.bitLength() / 8) @@ -43,5 +43,3 @@ function bnToU8a (value?: ExtToBn | BN | bigint | number return output; } - -export { bnToU8a }; diff --git a/packages/util/src/hex/toBn.ts b/packages/util/src/hex/toBn.ts index c656b605f..b9fb67c56 100644 --- a/packages/util/src/hex/toBn.ts +++ b/packages/util/src/hex/toBn.ts @@ -24,7 +24,7 @@ import { hexStripPrefix } from './stripPrefix'; * hexToBn('0x123480001f'); // => BN(0x123480001f) * ``` */ -function hexToBn (value?: string | null, { isLe = false, isNegative = false }: ToBnOptions = {}): BN { +export function hexToBn (value?: string | null, { isLe = false, isNegative = false }: ToBnOptions = {}): BN { if (!value || value === '0x') { return new BN(0); } @@ -38,5 +38,3 @@ function hexToBn (value?: string | null, { isLe = false, isNegative = false }: T ? bn.fromTwos(stripped.length * 4) : bn; } - -export { hexToBn }; diff --git a/packages/util/src/u8a/toBn.ts b/packages/util/src/u8a/toBn.ts index 745fd8bd7..0ed3aaeb8 100644 --- a/packages/util/src/u8a/toBn.ts +++ b/packages/util/src/u8a/toBn.ts @@ -23,7 +23,7 @@ import { BN } from '../bn/bn'; * u8aToHex(new Uint8Array([0x68, 0x65, 0x6c, 0x6c, 0xf])); // 0x68656c0f * ``` */ -function u8aToBn (value: Uint8Array, { isLe = true, isNegative = false }: ToBnOptions = {}): BN { +export function u8aToBn (value: Uint8Array, { isLe = true, isNegative = false }: ToBnOptions = {}): BN { const count = value.length; // shortcut for <= u48 values - in this case the manual conversion @@ -120,5 +120,3 @@ function u8aToBn (value: Uint8Array, { isLe = true, isNegative = false }: ToBnOp ? new BN(value, isLe ? 'le' : 'be').fromTwos(value.length * 8) : new BN(value, isLe ? 'le' : 'be'); } - -export { u8aToBn };