优化一处由于js对象引用类型引起的混乱

master 2.0.1
宇天 2017-05-22 13:26:53 +08:00
parent c2d8e2bcea
commit 572f7580eb
3 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,10 @@
1.0.0 / 2017-02-26
2.0.1 / 2017-05-22
==================
* 优化一处由于js对象引用类型引起的混乱
2.0.0 / 2017-02-26
==================
* new project

View File

@ -23,12 +23,13 @@ function parseWhere(arr){
it.join = it.join || 'AND'
it.op = it.op || '='
let fixVal = it.val
if(!/(^\(SELECT\s+.*\)$)|^`/.test(it.val) && !['IN', 'BETWEEN'].includes(it.op)){
it.val = mysql.escape(it.val)
fixVal = mysql.escape(it.val)
}
where += `${it.join.toUpperCase()} ${it.key} ${it.op} ${it.val} `
where += `${it.join.toUpperCase()} ${it.key} ${it.op} ${fixVal} `
}
where = ' WHERE ' + where.trim().replace(/^(AND|OR)/, ' ') + ' '

View File

@ -1,6 +1,6 @@
{
"name": "mysqli",
"version": "2.0.0",
"version": "2.0.1",
"description": "MySQL tool",
"main": "index.js",
"dependencies": {