@naturalcycles/mysql-lib 4.12.1 → 4.13.0
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/dist/mysql.db.js +3 -1
- package/dist/query.util.js +1 -0
- package/package.json +2 -2
- package/src/mysql.db.ts +1 -0
- package/src/query.util.ts +1 -0
package/dist/mysql.db.js
CHANGED
|
@@ -190,7 +190,9 @@ export class MysqlDB extends BaseCommonDB {
|
|
|
190
190
|
const rows = rowsInput.map(row => _mapValues(row, (_k, v) => {
|
|
191
191
|
if (v && typeof v === 'object' && !Buffer.isBuffer(v)) {
|
|
192
192
|
// This is to avoid implicit Date stringification and mismatch: it gets saved as Date, but loaded as String
|
|
193
|
-
_assert(
|
|
193
|
+
_assert(
|
|
194
|
+
// oxlint-disable-next-line no-restricted-globals -- detects Date values to reject them
|
|
195
|
+
!(v instanceof Date), 'mysql-lib does not support Date values, please stringify them before passing');
|
|
194
196
|
return JSON.stringify(v);
|
|
195
197
|
}
|
|
196
198
|
return v;
|
package/dist/query.util.js
CHANGED
|
@@ -137,6 +137,7 @@ function mapValueToMySQL(v) {
|
|
|
137
137
|
if (v &&
|
|
138
138
|
typeof v === 'object' &&
|
|
139
139
|
!Buffer.isBuffer(v) &&
|
|
140
|
+
// oxlint-disable-next-line no-restricted-globals -- Date values are left to the mysql driver to escape
|
|
140
141
|
!(v instanceof Date) &&
|
|
141
142
|
typeof v.toSqlString !== 'function') {
|
|
142
143
|
return JSON.stringify(v);
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"tslib": "^2"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@naturalcycles/dev-lib": "
|
|
13
|
+
"@naturalcycles/dev-lib": "20.71.0",
|
|
14
14
|
"@types/node": "^26",
|
|
15
15
|
"typescript": "^7"
|
|
16
16
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=26.12.1"
|
|
40
40
|
},
|
|
41
|
-
"version": "4.
|
|
41
|
+
"version": "4.13.0",
|
|
42
42
|
"description": "MySQL client implementing CommonDB interface",
|
|
43
43
|
"keywords": [
|
|
44
44
|
"mysql",
|
package/src/mysql.db.ts
CHANGED
|
@@ -302,6 +302,7 @@ export class MysqlDB extends BaseCommonDB implements CommonDB {
|
|
|
302
302
|
if (v && typeof v === 'object' && !Buffer.isBuffer(v)) {
|
|
303
303
|
// This is to avoid implicit Date stringification and mismatch: it gets saved as Date, but loaded as String
|
|
304
304
|
_assert(
|
|
305
|
+
// oxlint-disable-next-line no-restricted-globals -- detects Date values to reject them
|
|
305
306
|
!(v instanceof Date),
|
|
306
307
|
'mysql-lib does not support Date values, please stringify them before passing',
|
|
307
308
|
)
|
package/src/query.util.ts
CHANGED
|
@@ -178,6 +178,7 @@ function mapValueToMySQL(v: any): any {
|
|
|
178
178
|
v &&
|
|
179
179
|
typeof v === 'object' &&
|
|
180
180
|
!Buffer.isBuffer(v) &&
|
|
181
|
+
// oxlint-disable-next-line no-restricted-globals -- Date values are left to the mysql driver to escape
|
|
181
182
|
!(v instanceof Date) &&
|
|
182
183
|
typeof v.toSqlString !== 'function'
|
|
183
184
|
) {
|