1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.nToBigInt = nToBigInt;
|
7 |
|
8 | var _xBigint = require("@polkadot/x-bigint");
|
9 |
|
10 | var _toBigInt = require("../hex/toBigInt");
|
11 |
|
12 | var _bn = require("../is/bn");
|
13 |
|
14 | var _hex = require("../is/hex");
|
15 |
|
16 | var _toBigInt2 = require("../is/toBigInt");
|
17 |
|
18 | var _toBn = require("../is/toBn");
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | function nToBigInt(value) {
|
28 | return typeof value === 'bigint' ? value : !value ? (0, _xBigint.BigInt)(0) : (0, _hex.isHex)(value) ? (0, _toBigInt.hexToBigInt)(value.toString()) : (0, _bn.isBn)(value) ? (0, _xBigint.BigInt)(value.toString()) : (0, _toBigInt2.isToBigInt)(value) ? value.toBigInt() : (0, _toBn.isToBn)(value) ? (0, _xBigint.BigInt)(value.toBn().toString()) : (0, _xBigint.BigInt)(value);
|
29 | } |
\ | No newline at end of file |