@e-mc/db 0.8.30 → 0.8.31

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 (3) hide show
  1. package/README.md +6 -6
  2. package/index.js +9 -4
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/index.d.ts
12
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/index.d.ts
13
13
 
14
14
  ```typescript
15
15
  import type { DbDataSource } from "./squared";
@@ -94,11 +94,11 @@ interface DbPoolConstructor {
94
94
 
95
95
  ## References
96
96
 
97
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/squared.d.ts
98
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/core.d.ts
99
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/db.d.ts
100
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/object.d.ts
101
- - https://www.unpkg.com/@e-mc/types@0.8.30/lib/settings.d.ts
97
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/squared.d.ts
98
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/core.d.ts
99
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/db.d.ts
100
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/object.d.ts
101
+ - https://www.unpkg.com/@e-mc/types@0.8.31/lib/settings.d.ts
102
102
 
103
103
  ## LICENSE
104
104
 
package/index.js CHANGED
@@ -149,9 +149,9 @@ class Db extends core_1.ClientDb {
149
149
  }
150
150
  }
151
151
  async processRows(batch, tasks, parallel, outResult) {
152
- let disconnect;
152
+ let errorAsEmpty, disconnect;
153
153
  if ((0, types_1.isObject)(parallel)) {
154
- ({ disconnect, parallel } = parallel);
154
+ ({ parallel, errorAsEmpty, disconnect } = parallel);
155
155
  }
156
156
  const terminate = () => {
157
157
  this.applyState(batch, 8);
@@ -167,8 +167,13 @@ class Db extends core_1.ClientDb {
167
167
  this.applyState(batch, 16);
168
168
  terminate();
169
169
  if (outResult) {
170
- for (let i = 0, length = outResult.length; i < length; ++i) {
171
- outResult[i] = null;
170
+ if (errorAsEmpty) {
171
+ outResult.length = 0;
172
+ }
173
+ else {
174
+ for (let i = 0, length = outResult.length; i < length; ++i) {
175
+ outResult[i] = null;
176
+ }
172
177
  }
173
178
  return outResult;
174
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/db",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
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.8.30",
24
- "@e-mc/request": "0.8.30",
25
- "@e-mc/types": "0.8.30"
23
+ "@e-mc/core": "0.8.31",
24
+ "@e-mc/request": "0.8.31",
25
+ "@e-mc/types": "0.8.31"
26
26
  }
27
27
  }