@quentinadam/decimal 0.1.9 → 0.1.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.
Files changed (2) hide show
  1. package/dist/Decimal.js +7 -2
  2. package/package.json +2 -2
package/dist/Decimal.js CHANGED
@@ -38,8 +38,13 @@ export default class Decimal {
38
38
  *
39
39
  * @returns A string representing the Decimal value.
40
40
  */
41
- [Symbol.for('Deno.customInspect')]() {
42
- return this.toString();
41
+ [Symbol.for('Deno.customInspect')](inspect, options) {
42
+ const coloredNumber = inspect(0, options);
43
+ // deno-lint-ignore no-control-regex
44
+ const start = coloredNumber.match(/^\x1b\[[0-9;]*m/)?.[0] ?? '';
45
+ // deno-lint-ignore no-control-regex
46
+ const end = coloredNumber.match(/\x1b\[[0-9;]*m$/)?.[0] ?? '';
47
+ return `${start}${this.toString()}${end}`;
43
48
  }
44
49
  /**
45
50
  * Returns the absolute value of the current Decimal instance.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quentinadam/decimal",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "A library for working with arbitrary precision decimal numbers",
5
5
  "license": "MIT",
6
6
  "author": "Quentin Adam",
@@ -15,6 +15,6 @@
15
15
  "README.md"
16
16
  ],
17
17
  "dependencies": {
18
- "@quentinadam/assert": "^0.1.11"
18
+ "@quentinadam/assert": "^0.1.12"
19
19
  }
20
20
  }