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