Skip to content

Commit a576f41

Browse files
authored
🤖 Merge PR DefinitelyTyped#72847 fix(bn.js): bigint is actually supported as a side effect of .toString() by @JounQin
1 parent 5748552 commit a576f41

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

‎types/bn.js/bn.js-tests.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function runTests(BN: typeof BN_esm) {
3333
const actualArray = new BN([0x40, 0x20]);
3434
const actualUint8Array = new BN(new Uint8Array([0x40, 0x20]));
3535
const actualString = new BN("0x4020");
36+
const actualBigint = new BN(BigInt("0x4020"));
3637

3738
new BN("10", 16).modrn(256); // $ExpectType number
3839
BN.BN; // $ExpectType typeof BN

‎types/bn.js/index.d.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ declare class BN {
2323
static wordSize: 26;
2424

2525
constructor(
26-
number: number | string | number[] | Uint8Array | Buffer | BN,
26+
number: bigint | number | string | number[] | Uint8Array | Buffer | BN,
2727
base?: number | "hex",
2828
endian?: BN.Endianness,
2929
);
3030
constructor(
31-
number: number | string | number[] | Uint8Array | Buffer | BN,
31+
number: bigint | number | string | number[] | Uint8Array | Buffer | BN,
3232
endian?: BN.Endianness,
3333
);
3434

‎types/bn.js/package.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/bn.js",
4-
"version": "5.1.9999",
4+
"version": "5.2.9999",
55
"projects": [
66
"https://github.com/indutny/bn.js"
77
],
@@ -23,6 +23,10 @@
2323
{
2424
"name": "Gaylor Bosson",
2525
"githubUsername": "Gilthoniel"
26+
},
27+
{
28+
"name": "JounQin",
29+
"githubUsername": "JounQin"
2630
}
2731
]
2832
}

0 commit comments

Comments
 (0)