Socket
Socket
Sign inDemoInstall

pg

Package Overview
Dependencies
Maintainers
1
Versions
224
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

1

lib/types.js

@@ -66,2 +66,3 @@ //maps types from javascript to postgres and vise-versa

if (!val) return null;
if (val === '{}') return [];
if (val[0] !== '{' || val[val.length-1] !== '}')

@@ -68,0 +69,0 @@ throw "Not postgresql array! (" + arrStr + ")";

2

package.json
{ "name": "pg",
"version": "0.6.2",
"version": "0.6.3",
"description": "PostgreSQL client - pure javascript & libpq with the same API",

@@ -4,0 +4,0 @@ "keywords" : ["postgres", "pg", "libpq", "postgre", "database", "rdbms"],

@@ -120,2 +120,3 @@ #node-postgres

* [bdunavant](https://github.com/bdunavant)
* [tokumine](https://github.com/tokumine)

@@ -122,0 +123,0 @@ ## Documentation

var helper = require(__dirname + '/test-helper');
var q = {};
q.dateParser = require(__dirname + "/../../../lib/types").getStringTypeParser(1114);
q.stringArrayParser = require(__dirname + "/../../../lib/types").getStringTypeParser(1009);

@@ -39,1 +40,30 @@ test("testing dateParser", function() {

test("testing empty array", function(){
var input = '{}';
var expected = [];
assert.deepEqual(q.stringArrayParser(input), expected);
});
test("testing empty string array", function(){
var input = '{""}';
var expected = [""];
assert.deepEqual(q.stringArrayParser(input), expected);
});
test("testing numeric array", function(){
var input = '{1,2,3,4}';
var expected = [1,2,3,4];
assert.deepEqual(q.stringArrayParser(input), expected);
});
test("testing stringy array", function(){
var input = '{a,b,c,d}';
var expected = ['a','b','c','d'];
assert.deepEqual(q.stringArrayParser(input), expected);
});
test("testing NULL array", function(){
var input = '{NULL,NULL}';
var expected = [null,null];
assert.deepEqual(q.stringArrayParser(input), expected);
});
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