@ronin/compiler 0.13.2 → 0.13.3

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -808,10 +808,14 @@ var splitQuery = (query) => {
808
808
  };
809
809
 
810
810
  // src/utils/statement.ts
811
+ var replaceJSON = (key, value) => {
812
+ if (key === QUERY_SYMBOLS.EXPRESSION) return value.replaceAll(`'`, `''`);
813
+ return value;
814
+ };
811
815
  var prepareStatementValue = (statementParams, value) => {
812
816
  if (value === null) return "NULL";
813
817
  if (!statementParams) {
814
- const valueString = typeof value === "object" ? `json('${JSON.stringify(value)}')` : `'${value.toString()}'`;
818
+ const valueString = typeof value === "object" ? `json('${JSON.stringify(value, replaceJSON)}')` : `'${value.toString()}'`;
815
819
  return valueString;
816
820
  }
817
821
  let formattedValue = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ronin/compiler",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "type": "module",
5
5
  "description": "Compiles RONIN queries to SQL statements.",
6
6
  "publishConfig": {