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

pg.js

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg.js - npm Package Compare versions

Comparing version 2.5.1 to 2.6.0

15

lib/connection-parameters.js

@@ -38,2 +38,15 @@ var dns = require('dns');

var useSsl = function() {
switch(process.env.PGSSLMODE) {
case "disable":
return false;
case "prefer":
case "require":
case "verify-ca":
case "verify-full":
return true;
}
return defaults.ssl;
};
var ConnectionParameters = function(config) {

@@ -47,3 +60,3 @@ config = typeof config == 'string' ? parse(config) : (config || {});

this.binary = val('binary', config);
this.ssl = config.ssl || defaults.ssl;
this.ssl = config.ssl || useSsl();
this.client_encoding = val("client_encoding", config);

@@ -50,0 +63,0 @@ //a domain socket begins with '/'

@@ -1,2 +0,2 @@

module.exports = {
var defaults = module.exports = {
// database host defaults to localhost

@@ -39,3 +39,10 @@ host: 'localhost',

client_encoding: ""
client_encoding: "",
ssl: false
};
//parse int8 so you can get your count values as actual numbers
module.exports.__defineSetter__("parseInt8", function(val) {
require('./types').setTypeParser(20, 'text', val ? parseInt : function(val) { return val; });
});

@@ -38,2 +38,15 @@ var dns = require('dns');

var useSsl = function() {
switch(process.env.PGSSLMODE) {
case "disable":
return false;
case "prefer":
case "require":
case "verify-ca":
case "verify-full":
return true;
}
return defaults.ssl;
};
var ConnectionParameters = function(config) {

@@ -47,3 +60,3 @@ config = typeof config == 'string' ? parse(config) : (config || {});

this.binary = val('binary', config);
this.ssl = config.ssl || defaults.ssl;
this.ssl = config.ssl || useSsl();
this.client_encoding = val("client_encoding", config);

@@ -50,0 +63,0 @@ //a domain socket begins with '/'

4

lib/lib/defaults.js

@@ -39,3 +39,5 @@ var defaults = module.exports = {

client_encoding: ""
client_encoding: "",
ssl: false
};

@@ -42,0 +44,0 @@

@@ -20,3 +20,7 @@ var arrayParser = require(__dirname + "/arrayParser.js");

}
var year = match[1];
var isBC = /BC$/.test(isoDate);
var _year = parseInt(match[1], 10);
var isFirstCentury = (_year > 0) && (_year < 100);
var year = (isBC ? "-" : "") + match[1];
var month = parseInt(match[2],10)-1;

@@ -41,2 +45,3 @@ var day = match[3];

var tzAdjust = 0;
var date;
if(tZone) {

@@ -58,9 +63,14 @@ var type = tZone[1];

var utcOffset = Date.UTC(year, month, day, hour, min, seconds, mili);
return new Date(utcOffset - (tzAdjust * 60* 1000));
date = new Date(utcOffset - (tzAdjust * 60* 1000));
}
//no timezone information
else {
return new Date(year, month, day, hour, min, seconds, mili);
date = new Date(year, month, day, hour, min, seconds, mili);
}
if (isFirstCentury) {
date.setUTCFullYear(year);
}
return date;
};

@@ -67,0 +77,0 @@

{
"name": "pg.js",
"version": "2.5.1",
"version": "2.6.0",
"description": "node-postgres without the bindings",

@@ -5,0 +5,0 @@ "main": "index.js",

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