Socket
Socket
Sign inDemoInstall

pg-connection-string

Package Overview
Dependencies
Maintainers
3
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-connection-string - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

16

index.d.ts

@@ -5,11 +5,11 @@ export function parse(connectionString: string): ConnectionOptions;

host: string | null;
password: string | null;
user: string | null;
port: number | null;
database: string | null;
client_encoding: string | null;
ssl: boolean | null;
password?: string;
user?: string;
port?: string | null;
database: string | null | undefined;
client_encoding?: string;
ssl?: boolean | string;
application_name: string | null;
fallback_application_name: string | null;
application_name?: string;
fallback_application_name?: string;
}
'use strict';
var url = require('url');
var fs = require('fs');

@@ -26,2 +27,6 @@ //Parse method copied from https://github.com/brianc/node-postgres

var auth = (result.auth || ':').split(':');
config.user = auth[0];
config.password = auth.splice(1).join(':');
config.port = result.port;

@@ -44,6 +49,2 @@ if(result.protocol == 'socket:') {

var auth = (result.auth || ':').split(':');
config.user = auth[0];
config.password = auth.splice(1).join(':');
if (config.ssl === 'true' || config.ssl === '1') {

@@ -53,2 +54,22 @@ config.ssl = true;

if (config.ssl === '0') {
config.ssl = false;
}
if (config.sslcert || config.sslkey || config.sslrootcert) {
config.ssl = {};
}
if (config.sslcert) {
config.ssl.cert = fs.readFileSync(config.sslcert).toString();
}
if (config.sslkey) {
config.ssl.key = fs.readFileSync(config.sslkey).toString();
}
if (config.sslrootcert) {
config.ssl.ca = fs.readFileSync(config.sslrootcert).toString();
}
return config;

@@ -55,0 +76,0 @@ }

{
"name": "pg-connection-string",
"version": "2.0.0",
"version": "2.1.0",
"description": "Functions for dealing with a PostgresSQL connection string",

@@ -33,3 +33,7 @@ "main": "./index.js",

"mocha": "^3.5.0"
}
},
"files": [
"index.js",
"index.d.ts"
]
}
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