@ckb-ccc/core 1.8.0 → 1.8.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ckb-ccc/core
2
2
 
3
+ ## 1.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#205](https://github.com/ckb-devrel/ccc/pull/205) [`2e37ad7`](https://github.com/ckb-devrel/ccc/commit/2e37ad72fb98f3d7dc059299dafc9bba84dcb846) Thanks [@Hanssen0](https://github.com/Hanssen0)! - fix(core): falsy value is not empty in mol.Option
8
+
3
9
  ## 1.8.0
4
10
 
5
11
  ### Minor Changes
@@ -163,7 +163,7 @@ export function vector(itemCodec) {
163
163
  export function option(innerCodec) {
164
164
  return Codec.from({
165
165
  encode(userDefinedOrNull) {
166
- if (!userDefinedOrNull) {
166
+ if (userDefinedOrNull == null) {
167
167
  return bytesFrom([]);
168
168
  }
169
169
  try {
@@ -178,7 +178,7 @@ function vector(itemCodec) {
178
178
  function option(innerCodec) {
179
179
  return Codec.from({
180
180
  encode(userDefinedOrNull) {
181
- if (!userDefinedOrNull) {
181
+ if (userDefinedOrNull == null) {
182
182
  return (0, index_js_1.bytesFrom)([]);
183
183
  }
184
184
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckb-ccc/core",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Core of CCC - CKBer's Codebase",
5
5
  "author": "Hanssen0 <hanssen0@hanssen0.com>",
6
6
  "license": "MIT",
@@ -250,7 +250,7 @@ export function option<Encodable, Decoded>(
250
250
  ): Codec<Encodable | undefined | null, Decoded | undefined> {
251
251
  return Codec.from({
252
252
  encode(userDefinedOrNull) {
253
- if (!userDefinedOrNull) {
253
+ if (userDefinedOrNull == null) {
254
254
  return bytesFrom([]);
255
255
  }
256
256
  try {