不要怂,就是干,撸起袖子干!

Commit d984a6f5 by Chia-liang Kao

use Array.isArray and fix if-block style

1 parent a3185504
Showing with 2 additions and 1 deletions
...@@ -26,8 +26,9 @@ function pgEscape(val) { ...@@ -26,8 +26,9 @@ function pgEscape(val) {
case 'boolean': return (val) ? 'true' : 'false'; case 'boolean': return (val) ? 'true' : 'false';
case 'number': return val+''; case 'number': return val+'';
case 'object': case 'object':
if ({}.toString.call(val).slice(8, -1) === "Array") if (Array.isArray(val)) {
return 'ARRAY['+ val.map(function(it) { return pgEscape(it) }).join(',') +']'; return 'ARRAY['+ val.map(function(it) { return pgEscape(it) }).join(',') +']';
}
} }
if (val instanceof Date) { if (val instanceof Date) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!