infront-logger 1.1.3 → 1.1.4

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/dist/index.es.js CHANGED
@@ -449,16 +449,16 @@ class MongooseLogger extends BaseLogger {
449
449
  }
450
450
  }
451
451
  async function postHook(target, res) {
452
- var _a, _b, _c, _d, _e, _f;
453
- if (target.options.explain)
452
+ var _a, _b, _c, _d, _e, _f, _g;
453
+ if ((_a = target == null ? void 0 : target.options) == null ? void 0 : _a.explain)
454
454
  return;
455
455
  const op = target.constructor.name === "Aggregate" ? "aggregate" : target.op || target.$op;
456
- const collection = ((_a = target == null ? void 0 : target._collection) == null ? void 0 : _a.collectionName) || ((_b = target == null ? void 0 : target.collection) == null ? void 0 : _b.name) || ((_d = (_c = target == null ? void 0 : target._model) == null ? void 0 : _c.collection) == null ? void 0 : _d.collectionName);
457
- (_e = target == null ? void 0 : target.logger) == null ? void 0 : _e.operation(op).collection(collection).query(target._conditions).update(target._update).pipeline(target._pipeline).profile().result(res);
456
+ const collection = ((_b = target == null ? void 0 : target._collection) == null ? void 0 : _b.collectionName) || ((_c = target == null ? void 0 : target.collection) == null ? void 0 : _c.name) || ((_e = (_d = target == null ? void 0 : target._model) == null ? void 0 : _d.collection) == null ? void 0 : _e.collectionName);
457
+ (_f = target == null ? void 0 : target.logger) == null ? void 0 : _f.operation(op).collection(collection).query(target._conditions).update(target._update).pipeline(target._pipeline).profile().result(res);
458
458
  if (explained.includes(op)) {
459
459
  await (target == null ? void 0 : target.logger.explain(target));
460
460
  }
461
- (_f = target == null ? void 0 : target.logger) == null ? void 0 : _f.info(`DB query: ${op} - ${collection}`);
461
+ (_g = target == null ? void 0 : target.logger) == null ? void 0 : _g.info(`DB query: ${op} - ${collection}`);
462
462
  }
463
463
  function plugin(options = {}) {
464
464
  return (schema) => {
package/dist/index.umd.js CHANGED
@@ -453,16 +453,16 @@
453
453
  }
454
454
  }
455
455
  async function postHook(target, res) {
456
- var _a, _b, _c, _d, _e, _f;
457
- if (target.options.explain)
456
+ var _a, _b, _c, _d, _e, _f, _g;
457
+ if ((_a = target == null ? void 0 : target.options) == null ? void 0 : _a.explain)
458
458
  return;
459
459
  const op = target.constructor.name === "Aggregate" ? "aggregate" : target.op || target.$op;
460
- const collection = ((_a = target == null ? void 0 : target._collection) == null ? void 0 : _a.collectionName) || ((_b = target == null ? void 0 : target.collection) == null ? void 0 : _b.name) || ((_d = (_c = target == null ? void 0 : target._model) == null ? void 0 : _c.collection) == null ? void 0 : _d.collectionName);
461
- (_e = target == null ? void 0 : target.logger) == null ? void 0 : _e.operation(op).collection(collection).query(target._conditions).update(target._update).pipeline(target._pipeline).profile().result(res);
460
+ const collection = ((_b = target == null ? void 0 : target._collection) == null ? void 0 : _b.collectionName) || ((_c = target == null ? void 0 : target.collection) == null ? void 0 : _c.name) || ((_e = (_d = target == null ? void 0 : target._model) == null ? void 0 : _d.collection) == null ? void 0 : _e.collectionName);
461
+ (_f = target == null ? void 0 : target.logger) == null ? void 0 : _f.operation(op).collection(collection).query(target._conditions).update(target._update).pipeline(target._pipeline).profile().result(res);
462
462
  if (explained.includes(op)) {
463
463
  await (target == null ? void 0 : target.logger.explain(target));
464
464
  }
465
- (_f = target == null ? void 0 : target.logger) == null ? void 0 : _f.info(`DB query: ${op} - ${collection}`);
465
+ (_g = target == null ? void 0 : target.logger) == null ? void 0 : _g.info(`DB query: ${op} - ${collection}`);
466
466
  }
467
467
  function plugin(options = {}) {
468
468
  return (schema) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infront-logger",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"