pqb 0.31.9 → 0.32.0

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/dist/index.mjs CHANGED
@@ -1738,7 +1738,8 @@ class BooleanColumn extends ColumnType {
1738
1738
  }
1739
1739
  }
1740
1740
 
1741
- const toCodeSkip = { encodeFn: JSON.stringify };
1741
+ const encodeFn = (x) => x === null ? x : JSON.stringify(x);
1742
+ const toCodeSkip = { encodeFn };
1742
1743
  class JSONColumn extends ColumnType {
1743
1744
  constructor() {
1744
1745
  super(...arguments);
@@ -1749,7 +1750,7 @@ class JSONColumn extends ColumnType {
1749
1750
  return columnCode(this, t, `json()`, m, this.data, toCodeSkip);
1750
1751
  }
1751
1752
  }
1752
- JSONColumn.prototype.encodeFn = JSON.stringify;
1753
+ JSONColumn.prototype.encodeFn = encodeFn;
1753
1754
  class JSONTextColumn extends ColumnType {
1754
1755
  constructor(schema) {
1755
1756
  super(schema, schema.stringSchema());