New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pg-copy-streams-binary

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-copy-streams-binary - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

23

lib/deparser.js

@@ -31,2 +31,8 @@ /**

CopyStream.prototype.sendHeader = function(buf) {
buf.put(this.COPYSignature);
buf.word32be(0); // flags field (OID are not included in data)
buf.word32be(0); // Header extention area is empty
}
CopyStream.prototype._transform = function(chunk, enc, cb) {

@@ -40,5 +46,3 @@

this._headerSent = true;
buf.put(this.COPYSignature);
buf.word32be(0); // flags field (OID are not included in data)
buf.word32be(0); // Header extention area is empty
this.sendHeader(buf);
}

@@ -68,10 +72,19 @@

var buf = new BufferPut();
// See [1] - File Header Section
if (!this._headerSent) {
this._headerSent = true;
this.sendHeader(buf);
}
// See [1] - File Trailer section
if (!this._trailerSent) {
this._trailerSent = true;
var trailer = new Buffer([0xff, 0xff])
this.push(trailer)
buf.put(new Buffer([0xff, 0xff]));
}
this.push(buf.buffer());
cb();
}
{
"name": "pg-copy-streams-binary",
"version": "1.1.0",
"version": "1.1.1",
"description": "Streams for parsing and deparsing the COPY binary format",

@@ -31,4 +31,4 @@ "main": "index.js",

"pg": "^6.0.3",
"pg-copy-streams": "^1.1.1"
"pg-copy-streams": "^1.2.0"
}
}

@@ -13,2 +13,18 @@ var assert = require('assert');

var testEmpty = function() {
var fromClient = client();
fromClient.query('CREATE TEMP TABLE plug (col1 text)')
var txt = 'COPY plug FROM STDIN BINARY'
var copyIn = fromClient.query(copy(txt))
var copyUn = deparser({objectMode: true});
copyUn.pipe(copyIn);
copyUn.end()
var done = gonna('empty rows should not trigger error');
copyIn.on('end', function() {
done();
fromClient.end();
})
}
testEmpty();
var testType = function(type, ndim, value, expectedText) {

@@ -15,0 +31,0 @@ var fromClient = client()

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