@pi-r/gcp 0.8.0 → 0.8.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.
Files changed (2) hide show
  1. package/client/index.js +10 -14
  2. package/package.json +2 -2
package/client/index.js CHANGED
@@ -552,13 +552,9 @@ async function executeBatchQuery(credential, batch, sessionKey) {
552
552
  .then(() => {
553
553
  resolve();
554
554
  })
555
- .catch((error) => {
556
- reject(error);
557
- });
555
+ .catch(reject);
558
556
  })
559
- .catch((error) => {
560
- reject(error);
561
- });
557
+ .catch(reject);
562
558
  }
563
559
  });
564
560
  });
@@ -609,7 +605,9 @@ async function executeBatchQuery(credential, batch, sessionKey) {
609
605
  rows = [];
610
606
  await new Promise((resolve, reject) => {
611
607
  db.createReadStream(options)
612
- .on('data', row => rows.push(getRowData(row.id, row.data)))
608
+ .on('data', row => {
609
+ rows.push(getRowData(row.id, row.data));
610
+ })
613
611
  .on('error', reject)
614
612
  .on('end', resolve);
615
613
  });
@@ -713,19 +711,17 @@ async function executeBatchQuery(credential, batch, sessionKey) {
713
711
  db.runQuery(task.select('__key__'), options).then(entities => {
714
712
  if ((0, types_1.isArray)(entities)) {
715
713
  const items = entities.map((entity) => db.key(entity[db.KEY]));
716
- db.save({ key: items, data: update }).then(() => {
714
+ db.save({ key: items, data: update })
715
+ .then(() => {
717
716
  resolve();
718
- }).catch((err) => {
719
- reject(err);
720
- });
717
+ })
718
+ .catch(reject);
721
719
  }
722
720
  else {
723
721
  resolve();
724
722
  }
725
723
  })
726
- .catch((err) => {
727
- reject(err);
728
- });
724
+ .catch(reject);
729
725
  });
730
726
  }
731
727
  [rows] = await db.runQuery(task, options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/gcp",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Google (GCP) cloud functions for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "publishConfig": {
@@ -24,6 +24,6 @@
24
24
  "@e-mc/module": "^0.10.0",
25
25
  "@e-mc/types": "^0.10.0",
26
26
  "@google-cloud/firestore": "^7.9.0",
27
- "@google-cloud/storage": "^7.12.0"
27
+ "@google-cloud/storage": "^7.12.1"
28
28
  }
29
29
  }