@waves/bignumber
Advanced tools
Comparing version 0.0.1-a to 0.0.1-a2
@@ -1,2 +0,2 @@ | ||
import { BigNumber as BigNum } from 'bignumber.js'; | ||
import { default as BigNum } from 'bignumber.js'; | ||
import { Config, IFormat } from './Config'; | ||
@@ -36,3 +36,3 @@ declare type TLong = string | number | BigNumber; | ||
toFormat(decimals?: number, format?: IFormat): string; | ||
toFixed(decimals?: number): string; | ||
toFixed(decimals?: number, roundMode?: BigNumber.ROUND_MODE): string; | ||
toJSON(): string; | ||
@@ -61,2 +61,2 @@ static fromBytes(bytes: Uint8Array | Array<number>): BigNumber; | ||
} | ||
export {}; | ||
export default BigNumber; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var bignumber_js_1 = require("bignumber.js"); | ||
var bignumber_js_1 = __importDefault(require("bignumber.js")); | ||
var Config_1 = require("./Config"); | ||
@@ -97,3 +100,3 @@ var BigNumber = /** @class */ (function () { | ||
}; | ||
BigNumber.prototype.toFixed = function (decimals) { | ||
BigNumber.prototype.toFixed = function (decimals, roundMode) { | ||
if (decimals == null) { | ||
@@ -103,3 +106,3 @@ return this.bn.toFixed(); | ||
else { | ||
return this.bn.toFixed(decimals); | ||
return this.bn.toFixed(decimals, roundMode); | ||
} | ||
@@ -119,3 +122,3 @@ }; | ||
.join(''); | ||
var result = new BigNumber(new bignumber_js_1.BigNumber(byteString, 2)); | ||
var result = new BigNumber(new bignumber_js_1.default(byteString, 2)); | ||
if (isNegative) { | ||
@@ -161,3 +164,3 @@ return result.mul(-1).sub(1); | ||
BigNumber.toBigNumberJs = function (long) { | ||
if (bignumber_js_1.BigNumber.isBigNumber(long)) { | ||
if (bignumber_js_1.default.isBigNumber(long)) { | ||
return long; | ||
@@ -169,3 +172,3 @@ } | ||
else { | ||
return new bignumber_js_1.BigNumber(long); | ||
return new bignumber_js_1.default(long); | ||
} | ||
@@ -187,2 +190,3 @@ }; | ||
exports.BigNumber = BigNumber; | ||
exports.default = BigNumber; | ||
//# sourceMappingURL=BigNumber.js.map |
@@ -13,8 +13,11 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var bignumber_js_1 = require("bignumber.js"); | ||
var bignumber_js_1 = __importDefault(require("bignumber.js")); | ||
var Config = /** @class */ (function () { | ||
function Config() { | ||
this.format = Config.DEFAULT_FORMAT; | ||
bignumber_js_1.BigNumber.config({ FORMAT: this.format }); | ||
bignumber_js_1.default.config({ FORMAT: this.format }); | ||
} | ||
@@ -26,3 +29,3 @@ Config.prototype.set = function (configPart) { | ||
} | ||
bignumber_js_1.BigNumber.config(configPart); | ||
bignumber_js_1.default.config(configPart); | ||
}; | ||
@@ -29,0 +32,0 @@ Config.DEFAULT_FORMAT = { |
{ | ||
"name": "@waves/bignumber", | ||
"version": "0.0.1-a", | ||
"version": "0.0.1-a2", | ||
"description": "Waves Library for work with Bignumber in javascript", | ||
"main": "index.js", | ||
"types": "dist/index.d.ts", | ||
"browser": "dist/bignumber.umd.min.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/wavesplatform/bignumber.git" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"prepare": "tsc -p ./", | ||
"prepare": "tsc -p ./ && rollup -c", | ||
"postversion": "npm publish", | ||
@@ -32,2 +37,7 @@ "prepublish": "npm run test", | ||
"long": "^4.0.0", | ||
"rollup": "^1.12.3", | ||
"rollup-plugin-commonjs": "^10.0.0", | ||
"rollup-plugin-node-resolve": "^5.0.0", | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"rollup-plugin-uglify": "^6.0.2", | ||
"ts-jest": "^24.0.2", | ||
@@ -34,0 +44,0 @@ "typescript": "^3.4.5" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
142133
13
2970
0
11
1