Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-escape

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-escape - npm Package Compare versions

Comparing version 0.0.3 to 0.1.0

6

History.md
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 @@ ==================

6

index.js

@@ -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 + '"';
}
}

7

package.json
{
"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'");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc