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

pg

Package Overview
Dependencies
Maintainers
0
Versions
225
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.5.2 to 0.5.3

7

lib/writer.js

@@ -40,3 +40,8 @@ //binary data writer tuned for creating

p.addCString = function(string) {
var string = string || "";
//just write a 0 for empty or null strings
if(!string) {
this._ensure(1);
this.buffer[this.offset++] = 0;
return this;
}
var len = Buffer.byteLength(string) + 1;

@@ -43,0 +48,0 @@ this._ensure(len);

2

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

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

@@ -69,3 +69,10 @@ require(__dirname + "/test-helper");

})
test('writes two empty cstrings', function() {
var subject = new Writer();
var result = subject.addCString("").addCString("").join();
assert.equalBuffers(result, [0, 0])
})
test('writes non-empty cstring', function() {

@@ -72,0 +79,0 @@ var subject = new Writer();

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