@e-mc/db 0.10.0 → 0.10.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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Interface
11
11
 
12
- * [View Source](https://www.unpkg.com/@e-mc/types@0.10.0/lib/index.d.ts)
12
+ * [View Source](https://www.unpkg.com/@e-mc/types@0.10.1/lib/index.d.ts)
13
13
 
14
14
  ```typescript
15
15
  import type { DbDataSource } from "./squared";
@@ -204,11 +204,11 @@ const [rows1, rows2] = await instance.executeBatchQuery([
204
204
 
205
205
  ## References
206
206
 
207
- - https://www.unpkg.com/@e-mc/types@0.10.0/lib/squared.d.ts
208
- - https://www.unpkg.com/@e-mc/types@0.10.0/lib/core.d.ts
209
- - https://www.unpkg.com/@e-mc/types@0.10.0/lib/db.d.ts
210
- - https://www.unpkg.com/@e-mc/types@0.10.0/lib/http.d.ts
211
- - https://www.unpkg.com/@e-mc/types@0.10.0/lib/settings.d.ts
207
+ - https://www.unpkg.com/@e-mc/types@0.10.1/lib/squared.d.ts
208
+ - https://www.unpkg.com/@e-mc/types@0.10.1/lib/core.d.ts
209
+ - https://www.unpkg.com/@e-mc/types@0.10.1/lib/db.d.ts
210
+ - https://www.unpkg.com/@e-mc/types@0.10.1/lib/http.d.ts
211
+ - https://www.unpkg.com/@e-mc/types@0.10.1/lib/settings.d.ts
212
212
 
213
213
  * https://www.npmjs.com/package/@types/node
214
214
 
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { DbConstructor } from '../types/lib';
2
-
3
- declare const Db: DbConstructor;
4
-
1
+ import type { DbConstructor } from '../types/lib';
2
+
3
+ declare const Db: DbConstructor;
4
+
5
5
  export = Db;
package/index.js CHANGED
@@ -174,6 +174,12 @@ class Db extends core_1.ClientDb {
174
174
  }
175
175
  return Promise.all(tasks)
176
176
  .then(result => {
177
+ for (let i = 0, length = batch.length; i < length; ++i) {
178
+ const flat = batch[i].flat || 0;
179
+ if (flat > 0 && Array.isArray(result[i])) {
180
+ result[i] = result[i].flat(flat);
181
+ }
182
+ }
177
183
  terminate();
178
184
  if (outResult) {
179
185
  for (let i = 0, length = outResult.length; i < length; ++i) {
@@ -183,7 +189,7 @@ class Db extends core_1.ClientDb {
183
189
  }
184
190
  return result;
185
191
  })
186
- .catch(() => cleanup());
192
+ .catch(cleanup);
187
193
  }
188
194
  handleFail(err, item, options) {
189
195
  this.add(item, 32);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e-mc/db",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
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": "BSD 3-Clause",
21
21
  "homepage": "https://github.com/anpham6/e-mc#readme",
22
22
  "dependencies": {
23
- "@e-mc/core": "0.10.0",
24
- "@e-mc/request": "0.10.0",
25
- "@e-mc/types": "0.10.0"
23
+ "@e-mc/core": "0.10.1",
24
+ "@e-mc/request": "0.10.1",
25
+ "@e-mc/types": "0.10.1"
26
26
  }
27
27
  }
package/pool.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { DbPoolConstructor } from '../types/lib/db';
2
-
3
- declare const DbPool: DbPoolConstructor;
4
-
1
+ import type { DbPoolConstructor } from '../types/lib/db';
2
+
3
+ declare const DbPool: DbPoolConstructor;
4
+
5
5
  export = DbPool;