From 4ccd2e7dcad02f20cc3a0d312d883e114fc6e828 Mon Sep 17 00:00:00 2001 From: Fizcko <20943860+Fizcko@users.noreply.github.com> Date: Wed, 1 Feb 2023 07:30:19 +0100 Subject: [PATCH] Change RSQL custom operator regex --- package.json | 2 +- test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 81f8d8b..35d795f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rsql-mongodb", - "version": "1.5.3", + "version": "2.0.0", "description": "Converting RSQL queries to MongoDB queries", "main": "rsql-mongodb.js", "typings": "rsql-mongodb.ts", diff --git a/test.js b/test.js index 519420e..a908669 100644 --- a/test.js +++ b/test.js @@ -82,6 +82,7 @@ describe('rsql-mongodb', function () { }); it("Test errors", function () { expect(function () { rsqlMongoDB('azerty') }).to.throw('Wrong RSQL query. No operator found.'); + expect(function () { rsqlMongoDB('lastName=~do*') }).to.throw('Wrong RSQL query. No operator found.'); expect(function () { rsqlMongoDB("name=='SELECT (CHaR(75)||CHaR(76)||CHaR(77))'") }).to.throw('Wrong RSQL query. No operator found.'); expect(function () { rsqlMongoDB('firstName=={ $where: [ { lastName : "doe" } ] }') }).to.throw('Injection detected.'); expect(function () { rsqlMongoDB('birthday==1959-21-12') }).to.throw('Invalid Date.');