@sdflc/backend-helpers 1.0.33 → 1.0.34

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.
@@ -285,27 +285,28 @@ var BaseGateway = /** @class */ (function () {
285
285
  BaseGateway.prototype.create = function (args) {
286
286
  var _a;
287
287
  return __awaiter(this, void 0, void 0, function () {
288
- var objects, idx, len, arg, id, obj, result, chunks, idx, len, items;
289
- return __generator(this, function (_b) {
290
- switch (_b.label) {
288
+ var objects, idx, len, object, id, _b, _c, result, chunks, idx, len, items;
289
+ return __generator(this, function (_d) {
290
+ switch (_d.label) {
291
291
  case 0:
292
292
  objects = (0, lodash_1.castArray)(args);
293
293
  if (!args || objects.length === 0) {
294
294
  return [2 /*return*/, []];
295
295
  }
296
- idx = 0, len = args.length;
297
- _b.label = 1;
296
+ idx = 0, len = objects.length;
297
+ _d.label = 1;
298
298
  case 1:
299
299
  if (!(idx < len)) return [3 /*break*/, 5];
300
- arg = args[idx];
301
- return [4 /*yield*/, this.generateId(arg)];
300
+ object = objects[idx];
301
+ return [4 /*yield*/, this.generateId(object)];
302
302
  case 2:
303
- id = _b.sent();
304
- return [4 /*yield*/, this.transformOnCreate(__assign({ id: id }, arg))];
303
+ id = _d.sent();
304
+ _b = objects;
305
+ _c = idx;
306
+ return [4 /*yield*/, this.transformOnCreate(__assign({ id: id }, object))];
305
307
  case 3:
306
- obj = _b.sent();
307
- objects.push(obj);
308
- _b.label = 4;
308
+ _b[_c] = _d.sent();
309
+ _d.label = 4;
309
310
  case 4:
310
311
  ++idx;
311
312
  return [3 /*break*/, 1];
@@ -313,14 +314,14 @@ var BaseGateway = /** @class */ (function () {
313
314
  result = [];
314
315
  chunks = (0, utils_1.arrToChunks)(objects, ((_a = this.config) === null || _a === void 0 ? void 0 : _a.insertChunkSize) || DEFAULT_CHUNCK_SIZE);
315
316
  idx = 0, len = chunks.length;
316
- _b.label = 6;
317
+ _d.label = 6;
317
318
  case 6:
318
319
  if (!(idx < len)) return [3 /*break*/, 9];
319
320
  return [4 /*yield*/, this.getBuilder().insert(chunks[idx]).returning(this.config.returnFields)];
320
321
  case 7:
321
- items = _b.sent();
322
+ items = _d.sent();
322
323
  result.push.apply(result, items);
323
- _b.label = 8;
324
+ _d.label = 8;
324
325
  case 8:
325
326
  ++idx;
326
327
  return [3 /*break*/, 6];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdflc/backend-helpers",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",