Comparing version 0.0.3 to 0.1.0
v0.1.0 / 2015-04-13 | ||
=================== | ||
* add support for escaping array literals as tuples | ||
* add reserved.txt | ||
0.0.3 / 2014-06-18 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -84,2 +84,6 @@ | ||
if (null == val) return 'NULL'; | ||
if (Array.isArray(val)) { | ||
var vals = val.map(exports.literal) | ||
return "(" + vals.join(", ") + ")" | ||
} | ||
var backslash = ~val.indexOf('\\'); | ||
@@ -116,2 +120,2 @@ var prefix = backslash ? 'E' : ''; | ||
return '"' + id + '"'; | ||
} | ||
} |
{ | ||
"name": "pg-escape", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"repository": "segmentio/pg-escape", | ||
@@ -12,2 +12,5 @@ "description": "escape postgres queries which do not support stored procedures", | ||
], | ||
"scripts": { | ||
"test": "mocha --require should --reporter spec" | ||
}, | ||
"dependencies": {}, | ||
@@ -19,2 +22,2 @@ "devDependencies": { | ||
"license": "MIT" | ||
} | ||
} |
@@ -83,2 +83,6 @@ | ||
it('should return a tuple for arrays', function(){ | ||
escape.literal(["foo", "bar", "baz' DROP TABLE foo;"]).should.equal("('foo', 'bar', 'baz'' DROP TABLE foo;')"); | ||
}) | ||
it('should quote', function(){ | ||
@@ -85,0 +89,0 @@ escape.literal('hello world').should.equal("'hello world'"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7711
182