Comparing version 1.12.0 to 1.12.1
var array = require('postgres-array') | ||
var ap = require('ap') | ||
var arrayParser = require('./arrayParser'); | ||
@@ -31,5 +30,9 @@ var parseDate = require('postgres-date'); | ||
function parseBaseTenInt (string) { | ||
return parseInt(string, 10) | ||
} | ||
function parseIntegerArray (value) { | ||
if (!value) return null | ||
return array.parse(value, allowNull(ap.partialRight(parseInt, 10))) | ||
return array.parse(value, allowNull(parseBaseTenInt)) | ||
} | ||
@@ -89,8 +92,5 @@ | ||
var parseByteAArray = function(value) { | ||
var arr = parseStringArray(value); | ||
if (!arr) return arr; | ||
if (!value) { return null; } | ||
return arr.map(function(element) { | ||
return parseByteA(element); | ||
}); | ||
return array.parse(value, allowNull(parseByteA)); | ||
}; | ||
@@ -97,0 +97,0 @@ |
{ | ||
"name": "pg-types", | ||
"version": "1.12.0", | ||
"version": "1.12.1", | ||
"description": "Query result type converters for node-postgres", | ||
@@ -30,3 +30,2 @@ "main": "index.js", | ||
"dependencies": { | ||
"ap": "~0.2.0", | ||
"postgres-array": "~1.0.0", | ||
@@ -33,0 +32,0 @@ "postgres-bytea": "~1.0.0", |
@@ -276,3 +276,10 @@ 'use strict' | ||
t.ok(buffer.equals(value[0])) | ||
}] | ||
}], | ||
['{NULL,"\\\\x4e554c4c"}', function (t, value) { | ||
var buffer = new Buffer('4e554c4c', 'hex') | ||
t.ok(Array.isArray(value)) | ||
t.equal(value.length, 2) | ||
t.equal(value[0], null) | ||
t.ok(buffer.equals(value[1])) | ||
}], | ||
] | ||
@@ -279,0 +286,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28973
4
954