@e-mc/db 0.6.20 → 0.6.21

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.
Files changed (2) hide show
  1. package/index.js +9 -4
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -117,9 +117,9 @@ class Db extends core_1.ClientDb {
117
117
  }
118
118
  }
119
119
  async processRows(batch, tasks, parallel, outResult) {
120
- let disconnect;
120
+ let errorAsEmpty, disconnect;
121
121
  if ((0, types_1.isObject)(parallel)) {
122
- ({ disconnect, parallel } = parallel);
122
+ ({ parallel, errorAsEmpty, disconnect } = parallel);
123
123
  }
124
124
  const terminate = () => {
125
125
  this.applyState(batch, 8);
@@ -135,8 +135,13 @@ class Db extends core_1.ClientDb {
135
135
  this.applyState(batch, 16);
136
136
  terminate();
137
137
  if (outResult) {
138
- for (let i = 0, length = outResult.length; i < length; ++i) {
139
- outResult[i] = null;
138
+ if (errorAsEmpty) {
139
+ outResult.length = 0;
140
+ }
141
+ else {
142
+ for (let i = 0, length = outResult.length; i < length; ++i) {
143
+ outResult[i] = null;
144
+ }
140
145
  }
141
146
  return outResult;
142
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/db",
3
- "version": "0.6.20",
3
+ "version": "0.6.21",
4
4
  "description": "DB modules for E-mc.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.6.20",
24
- "@e-mc/request": "0.6.20",
25
- "@e-mc/types": "0.6.20"
23
+ "@e-mc/core": "0.6.21",
24
+ "@e-mc/request": "0.6.21",
25
+ "@e-mc/types": "0.6.21"
26
26
  }
27
27
  }