@totemsdk/core 1.2.7 → 1.2.8

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.
@@ -128,7 +128,15 @@ export class MiniNumber {
128
128
  else {
129
129
  s = s.slice(0, s.length - this.scale) + '.' + s.slice(s.length - this.scale);
130
130
  }
131
- s = s.replace(/(\.[0-9]*?)0+$/, '$1').replace(/\.$/, '');
131
+ const dotIdx = s.indexOf('.');
132
+ if (dotIdx !== -1) {
133
+ let end = s.length;
134
+ while (end > dotIdx + 1 && s[end - 1] === '0')
135
+ end -= 1;
136
+ if (end === dotIdx + 1)
137
+ end = dotIdx;
138
+ s = s.slice(0, end);
139
+ }
132
140
  return neg ? '-' + s : s;
133
141
  }
134
142
  assertSameScale(other) {
@@ -131,7 +131,15 @@ class MiniNumber {
131
131
  else {
132
132
  s = s.slice(0, s.length - this.scale) + '.' + s.slice(s.length - this.scale);
133
133
  }
134
- s = s.replace(/(\.[0-9]*?)0+$/, '$1').replace(/\.$/, '');
134
+ const dotIdx = s.indexOf('.');
135
+ if (dotIdx !== -1) {
136
+ let end = s.length;
137
+ while (end > dotIdx + 1 && s[end - 1] === '0')
138
+ end -= 1;
139
+ if (end === dotIdx + 1)
140
+ end = dotIdx;
141
+ s = s.slice(0, end);
142
+ }
135
143
  return neg ? '-' + s : s;
136
144
  }
137
145
  assertSameScale(other) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@totemsdk/core",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "description": "Core cryptographic primitives for Totem SDK — backed by Rust/WASM",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",