@ckb-ccc/core 1.3.0 → 1.3.1
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/CHANGELOG.md +6 -0
- package/dist/num/index.js +3 -3
- package/dist.commonjs/num/index.js +3 -3
- package/package.json +1 -1
- package/src/num/index.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ckb-ccc/core
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a48cccf`](https://github.com/ckb-devrel/ccc/commit/a48cccfae3ce6b3456a5eb863f207e7e5a6e568f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): numFrom("0x") should be zero
|
|
8
|
+
|
|
3
9
|
## 1.3.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/num/index.js
CHANGED
|
@@ -61,13 +61,13 @@ export function numFrom(val) {
|
|
|
61
61
|
if (typeof val === "bigint") {
|
|
62
62
|
return val;
|
|
63
63
|
}
|
|
64
|
+
if (val === "0x") {
|
|
65
|
+
return BigInt(0);
|
|
66
|
+
}
|
|
64
67
|
if (typeof val === "string" || typeof val === "number") {
|
|
65
68
|
return BigInt(val);
|
|
66
69
|
}
|
|
67
70
|
const hex = hexFrom(val);
|
|
68
|
-
if (hex === "0x") {
|
|
69
|
-
return BigInt(0);
|
|
70
|
-
}
|
|
71
71
|
return BigInt(hex);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
@@ -73,13 +73,13 @@ function numFrom(val) {
|
|
|
73
73
|
if (typeof val === "bigint") {
|
|
74
74
|
return val;
|
|
75
75
|
}
|
|
76
|
+
if (val === "0x") {
|
|
77
|
+
return BigInt(0);
|
|
78
|
+
}
|
|
76
79
|
if (typeof val === "string" || typeof val === "number") {
|
|
77
80
|
return BigInt(val);
|
|
78
81
|
}
|
|
79
82
|
const hex = (0, index_js_2.hexFrom)(val);
|
|
80
|
-
if (hex === "0x") {
|
|
81
|
-
return BigInt(0);
|
|
82
|
-
}
|
|
83
83
|
return BigInt(hex);
|
|
84
84
|
}
|
|
85
85
|
/**
|
package/package.json
CHANGED
package/src/num/index.ts
CHANGED
|
@@ -78,14 +78,14 @@ export function numFrom(val: NumLike): Num {
|
|
|
78
78
|
return val;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
if (val === "0x") {
|
|
82
|
+
return BigInt(0);
|
|
83
|
+
}
|
|
81
84
|
if (typeof val === "string" || typeof val === "number") {
|
|
82
85
|
return BigInt(val);
|
|
83
86
|
}
|
|
84
87
|
|
|
85
88
|
const hex = hexFrom(val);
|
|
86
|
-
if (hex === "0x") {
|
|
87
|
-
return BigInt(0);
|
|
88
|
-
}
|
|
89
89
|
return BigInt(hex);
|
|
90
90
|
}
|
|
91
91
|
|