@restura/core 0.1.0-alpha.25 → 0.1.0-alpha.26

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
@@ -926,7 +926,7 @@ function resturaGlobalTypesGenerator() {
926
926
  return `/** Auto generated file. DO NOT MODIFY **/
927
927
  /** This file contains types that may be used in the CustomTypes of Restura **/
928
928
  /** For example export interface MyPagedQuery extends Restura.PageQuery { } **/
929
-
929
+
930
930
  declare namespace Restura {
931
931
  export type StandardOrderTypes = 'ASC' | 'DESC' | 'RAND' | 'NONE';
932
932
  export interface PageQuery {
@@ -1508,7 +1508,22 @@ function escapeColumnName(columnName) {
1508
1508
  }
1509
1509
  function questionMarksToOrderedParams(query) {
1510
1510
  let count = 1;
1511
- return query.replace(/'\?'|\?/g, () => `$${count++}`);
1511
+ let inSingleQuote = false;
1512
+ let inDoubleQuote = false;
1513
+ return query.replace(/('|"|\?)/g, (char) => {
1514
+ if (char === "'") {
1515
+ inSingleQuote = !inSingleQuote && !inDoubleQuote;
1516
+ return char;
1517
+ }
1518
+ if (char === '"') {
1519
+ inDoubleQuote = !inDoubleQuote && !inSingleQuote;
1520
+ return char;
1521
+ }
1522
+ if (char === "?" && !inSingleQuote && !inDoubleQuote) {
1523
+ return `$${count++}`;
1524
+ }
1525
+ return char;
1526
+ });
1512
1527
  }
1513
1528
  function insertObjectQuery(table, obj) {
1514
1529
  const keys = Object.keys(obj);