@minatojs/sql-utils
Advanced tools
Comparing version 4.2.2 to 4.2.3
@@ -121,2 +121,3 @@ "use strict"; | ||
$concat: (args) => `concat(${args.map((arg) => this.parseEval(arg)).join(", ")})`, | ||
$regex: ([key, value]) => `${this.parseEval(key)} regexp ${this.parseEval(value)}`, | ||
// logical | ||
@@ -351,3 +352,3 @@ $or: (args) => this.logicalOr(args.map((arg) => this.parseEval(arg))), | ||
this.state.sqlType = "raw"; | ||
if (typeof expr === "string" || typeof expr === "number" || typeof expr === "boolean" || expr instanceof Date) { | ||
if (typeof expr === "string" || typeof expr === "number" || typeof expr === "boolean" || expr instanceof Date || expr instanceof RegExp) { | ||
return this.escape(expr); | ||
@@ -354,0 +355,0 @@ } |
{ | ||
"name": "@minatojs/sql-utils", | ||
"version": "4.2.2", | ||
"version": "4.2.3", | ||
"description": "SQL Utilities for Minato", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -130,2 +130,3 @@ import { Dict, isNullable } from 'cosmokit' | ||
$concat: (args) => `concat(${args.map(arg => this.parseEval(arg)).join(', ')})`, | ||
$regex: ([key, value]) => `${this.parseEval(key)} regexp ${this.parseEval(value)}`, | ||
@@ -394,3 +395,3 @@ // logical | ||
this.state.sqlType = 'raw' | ||
if (typeof expr === 'string' || typeof expr === 'number' || typeof expr === 'boolean' || expr instanceof Date) { | ||
if (typeof expr === 'string' || typeof expr === 'number' || typeof expr === 'boolean' || expr instanceof Date || expr instanceof RegExp) { | ||
return this.escape(expr) | ||
@@ -397,0 +398,0 @@ } |
Sorry, the diff of this file is not supported yet
60868
1080