@glif/filecoin-number
Advanced tools
Comparing version 2.0.47 to 2.0.48
@@ -46,2 +46,3 @@ /// <reference types="node" /> | ||
isWFIL?: boolean; | ||
isStFIL?: boolean; | ||
}): string; | ||
@@ -48,0 +49,0 @@ /** |
@@ -137,3 +137,3 @@ "use strict"; | ||
value: function formatBalance(options) { | ||
var _options$truncate, _options$decimals, _options$coinType, _options$addUnit, _options$isWFIL; | ||
var _options$truncate, _options$decimals, _options$coinType, _options$addUnit, _options$isWFIL, _options$isStFIL; | ||
@@ -145,5 +145,6 @@ var truncate = (_options$truncate = options === null || options === void 0 ? void 0 : options.truncate) !== null && _options$truncate !== void 0 ? _options$truncate : true; | ||
var isWFIL = (_options$isWFIL = options === null || options === void 0 ? void 0 : options.isWFIL) !== null && _options$isWFIL !== void 0 ? _options$isWFIL : false; | ||
var isStFIL = (_options$isStFIL = options === null || options === void 0 ? void 0 : options.isStFIL) !== null && _options$isStFIL !== void 0 ? _options$isStFIL : false; | ||
if (decimals < 0) throw new Error('Decimals must be >= 0'); | ||
if (this.isNaN()) throw new Error('Value cannot be NaN'); | ||
var unitPrefix = isWFIL ? 'w' : coinType === CoinType.TEST ? 't' : ''; | ||
var unitPrefix = isWFIL ? 'W' : isStFIL ? 'st' : coinType === CoinType.TEST ? 't' : ''; | ||
var format = { | ||
@@ -150,0 +151,0 @@ decimalSeparator: '.', |
@@ -118,3 +118,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
value: function formatBalance(options) { | ||
var _options$truncate, _options$decimals, _options$coinType, _options$addUnit, _options$isWFIL; | ||
var _options$truncate, _options$decimals, _options$coinType, _options$addUnit, _options$isWFIL, _options$isStFIL; | ||
@@ -126,5 +126,6 @@ var truncate = (_options$truncate = options === null || options === void 0 ? void 0 : options.truncate) !== null && _options$truncate !== void 0 ? _options$truncate : true; | ||
var isWFIL = (_options$isWFIL = options === null || options === void 0 ? void 0 : options.isWFIL) !== null && _options$isWFIL !== void 0 ? _options$isWFIL : false; | ||
var isStFIL = (_options$isStFIL = options === null || options === void 0 ? void 0 : options.isStFIL) !== null && _options$isStFIL !== void 0 ? _options$isStFIL : false; | ||
if (decimals < 0) throw new Error('Decimals must be >= 0'); | ||
if (this.isNaN()) throw new Error('Value cannot be NaN'); | ||
var unitPrefix = isWFIL ? 'w' : coinType === CoinType.TEST ? 't' : ''; | ||
var unitPrefix = isWFIL ? 'W' : isStFIL ? 'st' : coinType === CoinType.TEST ? 't' : ''; | ||
var format = { | ||
@@ -131,0 +132,0 @@ decimalSeparator: '.', |
@@ -105,5 +105,6 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
const isWFIL = (options === null || options === void 0 ? void 0 : options.isWFIL) ?? false; | ||
const isStFIL = (options === null || options === void 0 ? void 0 : options.isStFIL) ?? false; | ||
if (decimals < 0) throw new Error('Decimals must be >= 0'); | ||
if (this.isNaN()) throw new Error('Value cannot be NaN'); | ||
const unitPrefix = isWFIL ? 'w' : coinType === CoinType.TEST ? 't' : ''; | ||
const unitPrefix = isWFIL ? 'W' : isStFIL ? 'st' : coinType === CoinType.TEST ? 't' : ''; | ||
const format = { | ||
@@ -110,0 +111,0 @@ decimalSeparator: '.', |
{ | ||
"name": "@glif/filecoin-number", | ||
"version": "2.0.47", | ||
"version": "2.0.48", | ||
"description": "a javascript package to handle Filecoin numbers like Fil and AttoFil", | ||
@@ -50,3 +50,3 @@ "main": "./dist/index.js", | ||
}, | ||
"gitHead": "5dde2a4160c2b51eff154601f759d1247c82f409" | ||
"gitHead": "a6f64c391d4fcdd8e6d1100837cad4c4daf9733e" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
132686
1176