@arcblock/validator 1.30.1 → 1.30.2
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/esm/v/bn.mjs +1 -1
- package/lib/v/bn.cjs +4 -5
- package/package.json +5 -8
package/esm/v/bn.mjs
CHANGED
package/lib/v/bn.cjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
let valibot = require("valibot");
|
|
3
3
|
valibot = require_rolldown_runtime.__toESM(valibot);
|
|
4
|
-
let
|
|
5
|
-
bn_js = require_rolldown_runtime.__toESM(bn_js);
|
|
4
|
+
let _ocap_util = require("@ocap/util");
|
|
6
5
|
|
|
7
6
|
//#region src/v/bn.ts
|
|
8
|
-
const BN_ZERO = new
|
|
7
|
+
const BN_ZERO = new _ocap_util.BN(0);
|
|
9
8
|
const bnOps = {
|
|
10
9
|
gte: (a, b) => a.gte(b),
|
|
11
10
|
lte: (a, b) => a.lte(b),
|
|
@@ -19,7 +18,7 @@ const opLabels = {
|
|
|
19
18
|
lt: "<"
|
|
20
19
|
};
|
|
21
20
|
function bnCompare(op, threshold) {
|
|
22
|
-
const t =
|
|
21
|
+
const t = _ocap_util.BN.isBN(threshold) ? threshold : new _ocap_util.BN(threshold);
|
|
23
22
|
return valibot.check((value) => bnOps[op](value, t), `Value must be ${opLabels[op]} ${t.toString(10)}`);
|
|
24
23
|
}
|
|
25
24
|
const vBNMin = (t) => bnCompare("gte", t);
|
|
@@ -35,7 +34,7 @@ const vBNLt = vBNLess;
|
|
|
35
34
|
function safeBN(input) {
|
|
36
35
|
if (input === null || input === void 0 || typeof input === "number" && Number.isNaN(input)) return false;
|
|
37
36
|
try {
|
|
38
|
-
const bn = new
|
|
37
|
+
const bn = new _ocap_util.BN(input);
|
|
39
38
|
bn.toString(10);
|
|
40
39
|
return bn;
|
|
41
40
|
} catch {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "1.30.
|
|
7
|
+
"version": "1.30.2",
|
|
8
8
|
"description": "",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"main": "./lib/index.cjs",
|
|
@@ -41,15 +41,12 @@
|
|
|
41
41
|
"clean": "rm -rf lib esm"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@arcblock/did": "1.30.
|
|
45
|
-
"@ocap/mcrypto": "1.30.
|
|
46
|
-
"@ocap/util": "1.30.
|
|
47
|
-
"bn.js": "5.2.3",
|
|
44
|
+
"@arcblock/did": "1.30.2",
|
|
45
|
+
"@ocap/mcrypto": "1.30.2",
|
|
46
|
+
"@ocap/util": "1.30.2",
|
|
48
47
|
"valibot": "^1.3.1"
|
|
49
48
|
},
|
|
50
|
-
"resolutions": {
|
|
51
|
-
"bn.js": "5.2.3"
|
|
52
|
-
},
|
|
49
|
+
"resolutions": {},
|
|
53
50
|
"devDependencies": {
|
|
54
51
|
"tsdown": "^0.18.4",
|
|
55
52
|
"type-fest": "^3.1.0"
|