Comparing version 1.9.0 to 1.10.0
@@ -32,3 +32,3 @@ var array = require('postgres-array') | ||
if (!value) return null | ||
return array.parse(val, allowNull(function (item) { | ||
return array.parse(value, allowNull(function (entry) { | ||
return parseBigInteger(entry).trim() | ||
@@ -38,5 +38,5 @@ })) | ||
var parseFloatArray = function(val) { | ||
if(!val) { return null; } | ||
var p = arrayParser.create(val, function(entry) { | ||
var parseFloatArray = function(value) { | ||
if(!value) { return null; } | ||
var p = arrayParser.create(value, function(entry) { | ||
if(entry !== null) { | ||
@@ -51,13 +51,13 @@ entry = parseFloat(entry); | ||
var parseStringArray = function(val) { | ||
if(!val) { return null; } | ||
var parseStringArray = function(value) { | ||
if(!value) { return null; } | ||
var p = arrayParser.create(val); | ||
var p = arrayParser.create(value); | ||
return p.parse(); | ||
}; | ||
var parseDateArray = function(val) { | ||
if (!val) { return null; } | ||
var parseDateArray = function(value) { | ||
if (!value) { return null; } | ||
var p = arrayParser.create(val, function(entry) { | ||
var p = arrayParser.create(value, function(entry) { | ||
if (entry !== null) { | ||
@@ -72,4 +72,4 @@ entry = parseDate(entry); | ||
var parseByteAArray = function(val) { | ||
var arr = parseStringArray(val); | ||
var parseByteAArray = function(value) { | ||
var arr = parseStringArray(value); | ||
if (!arr) return arr; | ||
@@ -82,14 +82,14 @@ | ||
var parseInteger = function(val) { | ||
return parseInt(val, 10); | ||
var parseInteger = function(value) { | ||
return parseInt(value, 10); | ||
}; | ||
var parseBigInteger = function(val) { | ||
var valStr = String(val); | ||
var parseBigInteger = function(value) { | ||
var valStr = String(value); | ||
if (/^\d+$/.test(valStr)) { return valStr; } | ||
return val; | ||
return value; | ||
}; | ||
var parseJsonArray = function(val) { | ||
var arr = parseStringArray(val); | ||
var parseJsonArray = function(value) { | ||
var arr = parseStringArray(value); | ||
@@ -103,15 +103,15 @@ if (!arr) { | ||
var parsePoint = function(val) { | ||
if (val[0] !== '(') { return null; } | ||
var parsePoint = function(value) { | ||
if (value[0] !== '(') { return null; } | ||
val = val.substring( 1, val.length - 1 ).split(','); | ||
value = value.substring( 1, value.length - 1 ).split(','); | ||
return { | ||
x: parseFloat(val[0]) | ||
, y: parseFloat(val[1]) | ||
x: parseFloat(value[0]) | ||
, y: parseFloat(value[1]) | ||
}; | ||
}; | ||
var parseCircle = function(val) { | ||
if (val[0] !== '<' && val[1] !== '(') { return null; } | ||
var parseCircle = function(value) { | ||
if (value[0] !== '<' && value[1] !== '(') { return null; } | ||
@@ -121,8 +121,8 @@ var point = '('; | ||
var pointParsed = false; | ||
for (var i = 2; i < val.length - 1; i++){ | ||
for (var i = 2; i < value.length - 1; i++){ | ||
if (!pointParsed) { | ||
point += val[i]; | ||
point += value[i]; | ||
} | ||
if (val[i] === ')') { | ||
if (value[i] === ')') { | ||
pointParsed = true; | ||
@@ -134,7 +134,7 @@ continue; | ||
if (val[i] === ','){ | ||
if (value[i] === ','){ | ||
continue; | ||
} | ||
radius += val[i]; | ||
radius += value[i]; | ||
} | ||
@@ -141,0 +141,0 @@ var result = parsePoint(point); |
{ | ||
"name": "pg-types", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Query result type converters for node-postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
24871