mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
utils: convert tabs to spaces
This commit is contained in:
parent
7faa2b325e
commit
364cf4b3ca
44
lib/utils.js
44
lib/utils.js
@ -17,28 +17,28 @@ if(typeof events.EventEmitter.prototype.once !== 'function') {
|
||||
// uses comma separator so won't work for types like box that use
|
||||
// a different array separator.
|
||||
function arrayString(val) {
|
||||
var result = '{';
|
||||
for (var i = 0 ; i < val.length; i++) {
|
||||
if(i > 0) {
|
||||
result = result + ',';
|
||||
}
|
||||
if(val[i] instanceof Date) {
|
||||
result = result + JSON.stringify(val[i]);
|
||||
}
|
||||
else if(typeof val[i] === 'undefined') {
|
||||
result = result + 'NULL';
|
||||
}
|
||||
else if(Array.isArray(val[i])) {
|
||||
result = result + arrayString(val[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = result +
|
||||
(val[i] === null ? 'NULL' : JSON.stringify(val[i]));
|
||||
}
|
||||
}
|
||||
result = result + '}';
|
||||
return result;
|
||||
var result = '{';
|
||||
for (var i = 0 ; i < val.length; i++) {
|
||||
if(i > 0) {
|
||||
result = result + ',';
|
||||
}
|
||||
if(val[i] instanceof Date) {
|
||||
result = result + JSON.stringify(val[i]);
|
||||
}
|
||||
else if(typeof val[i] === 'undefined') {
|
||||
result = result + 'NULL';
|
||||
}
|
||||
else if(Array.isArray(val[i])) {
|
||||
result = result + arrayString(val[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = result +
|
||||
(val[i] === null ? 'NULL' : JSON.stringify(val[i]));
|
||||
}
|
||||
}
|
||||
result = result + '}';
|
||||
return result;
|
||||
}
|
||||
|
||||
//converts values from javascript types
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user