New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.2 to 0.0.3

reserved.txt

5

History.md
0.0.3 / 2014-06-18
==================
* fix idents as reserved words
0.0.2 / 2014-03-18

@@ -3,0 +8,0 @@ ==================

@@ -7,4 +7,15 @@

var assert = require('assert');
var fs = require('fs');
/**
* Reserved word map.
*/
var txt = fs.readFileSync(__dirname + '/reserved.txt', 'utf8');
var reserved = txt.split('\n').reduce(function(map, word){
map[word.toLowerCase()] = true;
return map;
}, {});
/**
* Expose `format()`.

@@ -90,2 +101,3 @@ */

function validIdent(id) {
if (reserved[id]) return false;
return /^[a-z_][a-z0-9_$]*$/i.test(id);

@@ -92,0 +104,0 @@ }

9

package.json
{
"name": "pg-escape",
"version": "0.0.2",
"version": "0.0.3",
"repository": "segmentio/pg-escape",
"description": "escape postgres queries which do not support stored procedures",
"keywords": ["pg", "postgres", "escape", "query"],
"keywords": [
"pg",
"postgres",
"escape",
"query"
],
"dependencies": {},

@@ -8,0 +13,0 @@ "devDependencies": {

@@ -61,2 +61,8 @@

it('should quote reserved words', function(){
escape.ident('desc').should.equal('"desc"');
escape.ident('join').should.equal('"join"');
escape.ident('cross').should.equal('"cross"');
})
it('should throw when null', function(done){

@@ -63,0 +69,0 @@ try {

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