mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Fixed a bug that caused parseStringArray() to not support empty arrays
This commit is contained in:
parent
b93ecbe15c
commit
a3d5d992f6
@ -60,6 +60,7 @@ var parseStringArray = function(val) {
|
||||
throw "Not postgresql array! (" + arrStr + ")";
|
||||
|
||||
var x = val.substring(1, val.length - 1);
|
||||
if (x === '') return [];
|
||||
x = x.match(/(NULL|[^,]+|"((?:.|\n|\r)*?)(?!\\)"|\{((?:.|\n|\r)*?(?!\\)\}) (,|$))/mg);
|
||||
if (x === null) throw "Not postgre array";
|
||||
return x.map(function (el) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user