Skip to content

Commit 48c6bf3

Browse files
authored
Merge pull request #108 from harinarayan-sharma-spraxa/main
fix: prevent incorrect parsing of quoted strings in named placeholders
2 parents b08ed17 + e4c4659 commit 48c6bf3

File tree

3 files changed

+412
-63
lines changed

3 files changed

+412
-63
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"main": "index.js",
55
"license": "MIT",
66
"type": "module",
7+
"scripts": {
8+
"postinstall": "patch-package"
9+
},
710
"exports": {
811
".": "./index.js",
912
"./mssql": "./lib/wrappers/mssql.js",
@@ -68,6 +71,7 @@
6871
"mssql": "^12.0.0",
6972
"mysql2": "^3.15.1",
7073
"objects-to-csv": "^1.3.6",
74+
"patch-package": "^8.0.1",
7175
"pino": "^10.0.0",
7276
"pino-abstract-transport": "^3.0.0",
7377
"pino-multi-stream": "^6.0.0",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
2+
index 3524ef5..6b64ad8 100644
3+
--- a/node_modules/named-placeholders/index.js
4+
+++ b/node_modules/named-placeholders/index.js
5+
@@ -40,7 +40,7 @@ function parse(query) {
6+
continue;
7+
}
8+
inQuote = false;
9+
- } else if (chr === DQUOTE || chr === SQUOTE) {
10+
+ } else if (!inQuote && (chr === DQUOTE || chr === SQUOTE)) {
11+
inQuote = true;
12+
qchr = chr;
13+
}

0 commit comments

Comments
 (0)