pg-promise 10.11.1 → 10.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/formatting.js
CHANGED
|
@@ -98,7 +98,7 @@ function formatValue({value, fm, cc, options}) {
|
|
|
98
98
|
if (value instanceof Date) {
|
|
99
99
|
return $to.date(value, isRaw);
|
|
100
100
|
}
|
|
101
|
-
if (value
|
|
101
|
+
if (Array.isArray(value)) {
|
|
102
102
|
return $to.array(value, options);
|
|
103
103
|
}
|
|
104
104
|
if (value instanceof Buffer) {
|
|
@@ -115,9 +115,9 @@ function formatValue({value, fm, cc, options}) {
|
|
|
115
115
|
// Arrays of any depth/dimension are supported.
|
|
116
116
|
//
|
|
117
117
|
// Top-level empty arrays are formatted as literal '{}' to avoid the necessity of explicit type casting,
|
|
118
|
-
// as the server cannot automatically infer type of an empty non-literal array.
|
|
118
|
+
// as the server cannot automatically infer the type of an empty non-literal array.
|
|
119
119
|
function formatArray(array, options) {
|
|
120
|
-
const loop = a => `[` + a.map(value => value
|
|
120
|
+
const loop = a => `[` + a.map(value => Array.isArray(value) ? loop(value) : formatValue({
|
|
121
121
|
value,
|
|
122
122
|
options
|
|
123
123
|
})).join() + `]`;
|
|
@@ -128,7 +128,7 @@ function formatArray(array, options) {
|
|
|
128
128
|
///////////////////////////////////////////////////////////////////
|
|
129
129
|
// Formats array/object/value as a list of comma-separated values.
|
|
130
130
|
function formatCSV(values, options) {
|
|
131
|
-
if (values
|
|
131
|
+
if (Array.isArray(values)) {
|
|
132
132
|
return values.map(value => formatValue({value, options})).join();
|
|
133
133
|
}
|
|
134
134
|
if (typeof values === `object` && values !== null) {
|
|
@@ -291,7 +291,7 @@ function formatQuery(query, values, raw, options) {
|
|
|
291
291
|
return formatQuery(query, resolveFunc(ctf.toPostgres, values), raw || ctf.rawType, options);
|
|
292
292
|
}
|
|
293
293
|
if (typeof values === `object` && values !== null) {
|
|
294
|
-
if (values
|
|
294
|
+
if (Array.isArray(values)) {
|
|
295
295
|
// $1, $2,... formatting to be applied;
|
|
296
296
|
return formatAs.array({query, array: values, raw, options});
|
|
297
297
|
}
|
|
@@ -688,7 +688,7 @@ const $as = {
|
|
|
688
688
|
if (isNull(arr)) {
|
|
689
689
|
return `null`;
|
|
690
690
|
}
|
|
691
|
-
if (arr
|
|
691
|
+
if (Array.isArray(arr)) {
|
|
692
692
|
return $to.array(arr, options);
|
|
693
693
|
}
|
|
694
694
|
throw new TypeError(`${wrapText(arr)} is not an Array object.`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pg-promise",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.12.1",
|
|
4
4
|
"description": "PostgreSQL interface for Node.js",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "typescript/pg-promise.d.ts",
|
|
@@ -36,25 +36,25 @@
|
|
|
36
36
|
},
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
39
|
+
"node": ">=12.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"assert-options": "0.7.0",
|
|
43
|
-
"pg": "8.
|
|
43
|
+
"pg": "8.8.0",
|
|
44
44
|
"pg-minify": "1.6.2",
|
|
45
45
|
"spex": "3.2.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "
|
|
48
|
+
"@types/node": "18.11.0",
|
|
49
49
|
"bluebird": "3.7.2",
|
|
50
50
|
"coveralls": "3.1.1",
|
|
51
|
-
"eslint": "8.0
|
|
51
|
+
"eslint": "8.25.0",
|
|
52
52
|
"istanbul": "0.4.5",
|
|
53
53
|
"jasmine-node": "3.0.0",
|
|
54
|
-
"jsdoc": "3.6.
|
|
54
|
+
"jsdoc": "3.6.11",
|
|
55
55
|
"JSONStream": "1.3.5",
|
|
56
|
-
"pg-query-stream": "4.2.
|
|
56
|
+
"pg-query-stream": "4.2.4",
|
|
57
57
|
"tslint": "6.1.3",
|
|
58
|
-
"typescript": "4.
|
|
58
|
+
"typescript": "4.8.4"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/typescript/README.MD
CHANGED
|
@@ -166,6 +166,7 @@ declare namespace pgPromise {
|
|
|
166
166
|
readonly def: any;
|
|
167
167
|
readonly castText: string;
|
|
168
168
|
readonly escapedName: string;
|
|
169
|
+
readonly variable: string;
|
|
169
170
|
readonly init: (col: IColumnDescriptor<T>) => any
|
|
170
171
|
readonly skip: (col: IColumnDescriptor<T>) => boolean
|
|
171
172
|
|