mysql2-core 0.2.1 → 0.2.2

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/index.js CHANGED
@@ -270,7 +270,12 @@ function query(pool, sql, args, m, bools) {
270
270
  else {
271
271
  if (results.length > 0) {
272
272
  var arrayResult = results.map(function (item) {
273
- return formatData(fields, item);
273
+ if (Array.isArray(item)) {
274
+ return formatData(fields, item);
275
+ }
276
+ else {
277
+ return item;
278
+ }
274
279
  });
275
280
  return resolve(handleResults(arrayResult, m, bools));
276
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2-core",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "mysql2-core",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/index.ts CHANGED
@@ -209,7 +209,11 @@ export async function query<T>(pool: Pool | PoolConnection, sql: string, args?:
209
209
  } else {
210
210
  if (results.length > 0) {
211
211
  const arrayResult = results.map(item => {
212
- return formatData<T>(fields, item);
212
+ if(Array.isArray(item)) {
213
+ return formatData<T>(fields, item);
214
+ } else {
215
+ return item
216
+ }
213
217
  });
214
218
  return resolve(handleResults(arrayResult, m, bools));
215
219
  } else {