Compare commits

...
3 Commits
Author SHA1 Message Date
Linden b1babdbc09 chore: Update version 2021-10-17 02:04:09 +11:00
Linden f8f97344fd Merge pull request #50 from darksaid98/varatstart
fix: Parameter keys beginning with ':' & '@'
2021-10-17 01:58:24 +11:00
darksaid98 48ee030372 fix: parameter keys beginning with : & @ 2021-10-16 16:02:43 +02:00
3 changed files with 15 additions and 6 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ game 'common'
name 'oxmysql' name 'oxmysql'
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.' description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
version '1.6.0' version '1.6.1'
url 'https://github.com/overextended/oxmysql' url 'https://github.com/overextended/oxmysql'
author 'overextended' author 'overextended'
use_fxv2_oal 'yes' use_fxv2_oal 'yes'
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "oxmysql", "name": "oxmysql",
"version": "1.6.0", "version": "1.6.1",
"main": "oxmysql.js", "main": "oxmysql.js",
"description": "node-mysql2 resource for Cfx", "description": "node-mysql2 resource for Cfx",
"repository": "[email protected]:overextended/oxmysql.git", "repository": "[email protected]:overextended/oxmysql.git",
+13 -4
View File
@@ -1,5 +1,5 @@
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
index 527d723..e50595d 100644 index 527d723..1ac61d5 100644
--- a/node_modules/named-placeholders/index.js --- a/node_modules/named-placeholders/index.js
+++ b/node_modules/named-placeholders/index.js +++ b/node_modules/named-placeholders/index.js
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
@@ -11,8 +11,17 @@ index 527d723..e50595d 100644
DQUOTE = 34, DQUOTE = 34,
SQUOTE = 39, SQUOTE = 39,
BSLASH = 92; BSLASH = 92;
@@ -96,13 +96,13 @@ function createCompiler(config) { @@ -94,15 +94,22 @@ function createCompiler(config) {
if (typeof params == 'undefined')
throw new Error('Named query contains placeholders, but parameters object is undefined');
+ for(const key in params) {
+ if(key.charAt(0) === '@' || key.charAt(0) === ':') {
+ params[key.substring(1)] = params[key];
+ delete params[key];
+ }
+ }
+
const tokens = tree[1]; const tokens = tree[1];
for (let i=0; i < tokens.length; ++i) { for (let i=0; i < tokens.length; ++i) {
- arr.push(params[tokens[i]]); - arr.push(params[tokens[i]]);
@@ -27,7 +36,7 @@ index 527d723..e50595d 100644
return s.slice(0, -1); return s.slice(0, -1);
} }
return s; return s;
@@ -115,7 +115,7 @@ function createCompiler(config) { @@ -115,7 +122,7 @@ function createCompiler(config) {
let unnamed = noTailingSemicolon(tree[0][0]); let unnamed = noTailingSemicolon(tree[0][0]);
for (let i=1; i < tree[0].length; ++i) { for (let i=1; i < tree[0].length; ++i) {
@@ -36,7 +45,7 @@ index 527d723..e50595d 100644
unnamed += config.placeholder; unnamed += config.placeholder;
} }
unnamed += config.placeholder; unnamed += config.placeholder;
@@ -124,7 +124,7 @@ function createCompiler(config) { @@ -124,7 +131,7 @@ function createCompiler(config) {
const last = tree[0][tree[0].length -1]; const last = tree[0][tree[0].length -1];
if (tree[0].length == tree[1].length) { if (tree[0].length == tree[1].length) {