think-model-postgresql
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -109,2 +109,3 @@ const { Parser } = require('think-model-abstract'); | ||
if (helper.isBoolean(value)) return value ? 'true' : 'false'; | ||
if (helper.isBuffer(value)) return `'\\x${value.toString('hex')}'`; | ||
if (value === null) return 'null'; | ||
@@ -122,2 +123,9 @@ return value; | ||
} | ||
/** | ||
* escape string | ||
* @param {String} str | ||
*/ | ||
escapeString(str) { | ||
return str.replace(/'/g, "\\'"); | ||
} | ||
}; |
{ | ||
"name": "think-model-postgresql", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "PostgreSQL adapter for ThinkJS 3.x", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -60,2 +60,3 @@ const { test } = require('ava'); | ||
['lizheming', "E'lizheming'"], | ||
["I'm my wife's rock.", "E'I\\\'m my wife\\\'s rock.'"], | ||
[3, 3], | ||
@@ -67,3 +68,4 @@ [{ a: 1 }, { a: 1 }], | ||
[['EXP', '= 3'], '= 3'], | ||
[[{ a: 1 }, 3, true, null, ['EXP', ' = 3']], [{ a: 1 }, 3, 'true', 'null', ' = 3']] | ||
[[{ a: 1 }, 3, true, null, ['EXP', ' = 3']], [{ a: 1 }, 3, 'true', 'null', ' = 3']], | ||
[Buffer.from('abcdefg'), "'\\x61626364656667'"] | ||
]; | ||
@@ -70,0 +72,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
44284
1288
0