postgres-bytea
Advanced tools
+4
-2
| 'use strict' | ||
| var bufferFrom = Buffer.from || Buffer | ||
| module.exports = function parseBytea (input) { | ||
| if (/^\\x/.test(input)) { | ||
| // new 'hex' style response (pg >9.0) | ||
| return new Buffer(input.substr(2), 'hex') | ||
| return bufferFrom(input.substr(2), 'hex') | ||
| } | ||
@@ -30,3 +32,3 @@ var output = '' | ||
| } | ||
| return new Buffer(output, 'binary') | ||
| return bufferFrom(output, 'binary') | ||
| } |
+1
-1
| { | ||
| "name": "postgres-bytea", | ||
| "main": "index.js", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "Postgres bytea parser", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
3095
1.31%31
3.33%