@agrozyme/numeric 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/index.d.ts CHANGED
@@ -23,7 +23,6 @@ export interface IFormatNumberOptions {
23
23
  }
24
24
  export declare class Numeric extends Decimal {
25
25
  constructor(value: NumericValue);
26
- get [Symbol.toStringTag](): string;
27
26
  static abs(value: NumericValue): Numeric;
28
27
  static acos(value: NumericValue): Numeric;
29
28
  static acosh(value: NumericValue): Numeric;
package/out/index.js CHANGED
@@ -4,12 +4,12 @@ exports.MinInt256 = exports.MaxInt256 = exports.MaxUint256 = exports.WeiPerEther
4
4
  const tslib_1 = require("tslib");
5
5
  const bignumber_1 = require("@ethersproject/bignumber");
6
6
  const bytes_1 = require("@ethersproject/bytes");
7
- const constants = (0, tslib_1.__importStar)(require("@ethersproject/constants"));
8
- const big_integer_1 = (0, tslib_1.__importDefault)(require("big-integer"));
9
- const bn_js_1 = (0, tslib_1.__importDefault)(require("bn.js"));
7
+ const constants = tslib_1.__importStar(require("@ethersproject/constants"));
8
+ const big_integer_1 = tslib_1.__importDefault(require("big-integer"));
9
+ const bn_js_1 = tslib_1.__importDefault(require("bn.js"));
10
10
  const browser_or_node_1 = require("browser-or-node");
11
11
  const decimal_js_1 = require("decimal.js");
12
- const format_number_1 = (0, tslib_1.__importDefault)(require("format-number"));
12
+ const format_number_1 = tslib_1.__importDefault(require("format-number"));
13
13
  //noinspection FunctionNamingConventionJS
14
14
  class Numeric extends decimal_js_1.Decimal {
15
15
  constructor(value) {
@@ -39,9 +39,9 @@ class Numeric extends decimal_js_1.Decimal {
39
39
  }
40
40
  }
41
41
  }
42
- get [Symbol.toStringTag]() {
43
- return 'Numeric';
44
- }
42
+ // get [Symbol.toStringTag]() {
43
+ // return 'Numeric';
44
+ // }
45
45
  static abs(value) {
46
46
  return new Numeric(value).abs();
47
47
  }
package/out/index.mjs CHANGED
@@ -35,9 +35,9 @@ export class Numeric extends Decimal {
35
35
  }
36
36
  }
37
37
  }
38
- get [Symbol.toStringTag]() {
39
- return 'Numeric';
40
- }
38
+ // get [Symbol.toStringTag]() {
39
+ // return 'Numeric';
40
+ // }
41
41
  static abs(value) {
42
42
  return new Numeric(value).abs();
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agrozyme/numeric",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "",
5
5
  "main": "out/index.js",
6
6
  "module": "out/index.mjs",
@@ -11,6 +11,12 @@
11
11
  "require": "./out/index.js"
12
12
  }
13
13
  },
14
+ "scripts": {
15
+ "clean": "shx rm -f *.tsbuildinfo && shx rm -rf out",
16
+ "build": "npm run clean && tsc-multi --force",
17
+ "prepublishOnly": "npm run build",
18
+ "test": "jasmine --config=jasmine.json"
19
+ },
14
20
  "repository": {
15
21
  "type": "git",
16
22
  "url": "git+ssh://git@gitlab.com/agrozyme-package/JavaScript/numeric.git"
@@ -27,26 +33,18 @@
27
33
  "@types/jasmine": "^3",
28
34
  "@types/node": "^17",
29
35
  "jasmine": "^4",
36
+ "prettier": "^2",
30
37
  "shx": "^0",
31
38
  "ts-node": "^10",
32
39
  "tsc-multi": "^0",
33
40
  "typescript": "^4"
34
41
  },
35
42
  "dependencies": {
36
- "@ethersproject/bignumber": "^5",
37
- "@ethersproject/bytes": "^5",
38
43
  "@ethersproject/constants": "^5",
39
44
  "big-integer": "^1",
40
- "bn.js": "^5",
41
45
  "browser-or-node": "^2",
42
46
  "decimal.js": "^10",
43
47
  "format-number": "^3",
44
48
  "tslib": "^2"
45
- },
46
- "scripts": {
47
- "clean": "shx rm -f *.tsbuildinfo && shx rm -rf out",
48
- "build": "npm run clean && tsc-multi --force",
49
- "test": "jasmine --config=jasmine.json"
50
- },
51
- "readme": "# Numeric\n\nA wrapper of Decimal.js\n\n## Usage\n\nSee the source code for more details.\n\nAll functions are same as Decimal.js and can convert from:\n\n- String\n- Number\n- BigInt\n- Array of Number\n- [bn.js](https://www.npmjs.com/package/bn.js)\n- [BigInteger.js](https://www.npmjs.com/package/big-integer)\n- [Big Numbers](https://www.npmjs.com/package/@ethersproject/bignumber)\n- [Decimal.js](https://www.npmjs.com/package/decimal.js)\n\nExamples:\n\n```ts\nimport { Numeric } from '@agrozyme/numeric';\nconst test1 = new Numeric('1');\nconst test2 = new Numeric(2);\nconst test3 = new Numeric(3n);\nconst test4 = new Numeric([4]);\nconst test5 = new Numeric(new BN(5));\nconst test6 = new Numeric(bigInt('6'));\nconst test7 = new Numeric(BigNumber.from(7));\nconst test8 = new Numeric(new Decimal(8));\n```\n\n## Constants\n\nSame as [Etehreum Constants](https://www.npmjs.com/package/@ethersproject/constants) bignumber constants but export to Numeric type\n\n- NegativeOne\n- Zero\n- One\n- Two\n- WeiPerEther\n- MaxUint256\n- MaxInt256\n- MinInt256\n\n## Helper Functions\n\n- createArrayCompareFunction: create a simple array compare function\n\n```ts\nconst ascending = createArrayCompareFunction(true);\nconst descending = createArrayCompareFunction(false);\n```\n\n- formatValue: use [format-number](https://www.npmjs.com/package/format-number) to format a Numeric-Like value\n\n```ts\nconst text = formatValue(1000, { prefix: '$' });\n```\n\n## Convert Functions\n\nAll convert functions are accept one Numeric-Like argument, except `toNumerics`\n\n- toNumerics: convert a Numeric-Like array to a Numeric array\n\n```ts\nimport { toNumerics } from '@agrozyme/numeric';\nconst test = toNumerics(['1', 2, 3n]);\n```\n\n- toNumeric: convert a Numeric-Like value to a Numeric value\n- toIntegerString: convert a Numeric-Like value to a interger string\n- toBigInt: convert a Numeric-Like value to a `native` bigint value\n- toBN: convert a Numeric-Like value to a BN value\n- toBigInteger: convert a Numeric-Like value to a BigInteger value\n- toBigNumber: convert a Numeric-Like value to a BigNumber value\n\n## Config Functions\n\n- getNumericConfig: get NumericConfig that same as [Decimal.Config](https://mikemcl.github.io/decimal.js/#constructor-properties)\n- setupNumericConfig: setup NumericConfig\n"
52
- }
49
+ }
50
+ }
package/root/index.ts CHANGED
@@ -56,9 +56,9 @@ export class Numeric extends Decimal {
56
56
  }
57
57
  }
58
58
 
59
- get [Symbol.toStringTag]() {
60
- return 'Numeric';
61
- }
59
+ // get [Symbol.toStringTag]() {
60
+ // return 'Numeric';
61
+ // }
62
62
 
63
63
  static abs(value: NumericValue) {
64
64
  return new Numeric(value).abs();
@@ -526,7 +526,7 @@ export class Numeric extends Decimal {
526
526
 
527
527
  inspect(depth: number, options: InspectOptionsStylized) {
528
528
  const value = this.toFixed();
529
- return isNode ? options.stylize(value, 'bigint'): value;
529
+ return isNode ? options.stylize(value, 'bigint') : value;
530
530
  }
531
531
  }
532
532