@tstdl/base 0.88.5 → 0.88.6

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.
@@ -1,6 +1,6 @@
1
1
  import { NotFoundError } from '../../error/not-found.error.js';
2
2
  import { objectKeys } from '../../utils/object/object.js';
3
- import { assertDefined, isNullOrUndefined } from '../../utils/type-guards.js';
3
+ import { assertDefined, isNull, isNullOrUndefined } from '../../utils/type-guards.js';
4
4
  import { mongoDocumentFromMaybeNewEntity, toEntity, toMongoDocument, toMongoProjection, toNewEntity, toProjectedEntity } from './model/document.js';
5
5
  import { MongoBulk } from './mongo-bulk.js';
6
6
  import { replaceOneOperation, updateOneOperation } from './operations.js';
@@ -116,18 +116,18 @@ export class MongoBaseRepository {
116
116
  }
117
117
  async tryLoadByFilterAndDelete(filter, options) {
118
118
  const result = await this.collection.findOneAndDelete(filter, options);
119
- if (result.value == undefined) {
119
+ if (isNull(result)) {
120
120
  return undefined;
121
121
  }
122
- return toEntity(result.value);
122
+ return toEntity(result);
123
123
  }
124
124
  async loadByFilterAndUpdate(filter, update, options) {
125
125
  const entity = await this.tryLoadByFilterAndUpdate(filter, update, options);
126
126
  return throwIfUndefinedElsePass(entity, this.collection.collectionName);
127
127
  }
128
128
  async tryLoadByFilterAndUpdate(filter, update, options) {
129
- const { value: document } = await this.collection.findOneAndUpdate(filter, update, options);
130
- if (document == undefined) {
129
+ const document = await this.collection.findOneAndUpdate(filter, update, options);
130
+ if (isNull(document)) {
131
131
  return undefined;
132
132
  }
133
133
  return toEntity(document);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.88.5",
3
+ "version": "0.88.6",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -120,7 +120,7 @@
120
120
  "./utils/string": "./utils/object/index.js"
121
121
  },
122
122
  "dependencies": {
123
- "disposablestack": "^1.1.1",
123
+ "disposablestack": "^1.1",
124
124
  "luxon": "^3.4",
125
125
  "reflect-metadata": "^0.1",
126
126
  "rxjs": "^7.8",
@@ -159,9 +159,9 @@
159
159
  "koa": "^2.14",
160
160
  "minio": "^7.1",
161
161
  "mjml": "^4.14",
162
- "mongodb": "^5.8",
162
+ "mongodb": "^6.1",
163
163
  "nodemailer": "^6.9",
164
- "playwright": "^1.37",
164
+ "playwright": "^1.38",
165
165
  "preact": "^10.17",
166
166
  "preact-render-to-string": "^6.2",
167
167
  "undici": "^5.24",