@event-driven-io/emmett-mongodb 0.37.0 → 0.38.0-alpha.2
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.cjs +28 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var _webstreamspolyfill = require('web-streams-polyfill');
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
|
|
36
37
|
var _asyncretry = require('async-retry'); var _asyncretry2 = _interopRequireDefault(_asyncretry);
|
|
37
38
|
|
|
38
39
|
|
|
@@ -225,6 +226,33 @@ var asyncRetry = async (fn, opts) => {
|
|
|
225
226
|
_nullishCoalesce(opts, () => ( { retries: 0 }))
|
|
226
227
|
);
|
|
227
228
|
};
|
|
229
|
+
var AssertionError = class extends Error {
|
|
230
|
+
constructor(message2) {
|
|
231
|
+
super(message2);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var isSubset = (superObj, subObj) => {
|
|
235
|
+
const sup = superObj;
|
|
236
|
+
const sub = subObj;
|
|
237
|
+
assertOk(sup);
|
|
238
|
+
assertOk(sub);
|
|
239
|
+
return Object.keys(sub).every((ele) => {
|
|
240
|
+
if (typeof sub[ele] == "object") {
|
|
241
|
+
return isSubset(sup[ele], sub[ele]);
|
|
242
|
+
}
|
|
243
|
+
return sub[ele] === sup[ele];
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
var assertFails = (message2) => {
|
|
247
|
+
throw new AssertionError(_nullishCoalesce(message2, () => ( "That should not ever happened, right?")));
|
|
248
|
+
};
|
|
249
|
+
function assertTrue(condition, message2) {
|
|
250
|
+
if (condition !== true)
|
|
251
|
+
throw new AssertionError(_nullishCoalesce(message2, () => ( `Condition is false`)));
|
|
252
|
+
}
|
|
253
|
+
function assertOk(obj, message2) {
|
|
254
|
+
if (!obj) throw new AssertionError(_nullishCoalesce(message2, () => ( `Condition is not truthy`)));
|
|
255
|
+
}
|
|
228
256
|
var filterProjections = (type, projections2) => {
|
|
229
257
|
const inlineProjections2 = projections2.filter((projection2) => projection2.type === type).map(({ projection: projection2 }) => projection2);
|
|
230
258
|
const duplicateRegistrations = arrayUtils.getDuplicates(
|
|
@@ -392,33 +420,6 @@ var streamTransformations = {
|
|
|
392
420
|
waitAtMost
|
|
393
421
|
};
|
|
394
422
|
var { retry: retry2 } = streamTransformations;
|
|
395
|
-
var AssertionError = class extends Error {
|
|
396
|
-
constructor(message2) {
|
|
397
|
-
super(message2);
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
var isSubset = (superObj, subObj) => {
|
|
401
|
-
const sup = superObj;
|
|
402
|
-
const sub = subObj;
|
|
403
|
-
assertOk(sup);
|
|
404
|
-
assertOk(sub);
|
|
405
|
-
return Object.keys(sub).every((ele) => {
|
|
406
|
-
if (typeof sub[ele] == "object") {
|
|
407
|
-
return isSubset(sup[ele], sub[ele]);
|
|
408
|
-
}
|
|
409
|
-
return sub[ele] === sup[ele];
|
|
410
|
-
});
|
|
411
|
-
};
|
|
412
|
-
var assertFails = (message2) => {
|
|
413
|
-
throw new AssertionError(_nullishCoalesce(message2, () => ( "That should not ever happened, right?")));
|
|
414
|
-
};
|
|
415
|
-
function assertTrue(condition, message2) {
|
|
416
|
-
if (condition !== true)
|
|
417
|
-
throw new AssertionError(_nullishCoalesce(message2, () => ( `Condition is false`)));
|
|
418
|
-
}
|
|
419
|
-
function assertOk(obj, message2) {
|
|
420
|
-
if (!obj) throw new AssertionError(_nullishCoalesce(message2, () => ( `Condition is not truthy`)));
|
|
421
|
-
}
|
|
422
423
|
|
|
423
424
|
// src/eventStore/mongoDBEventStore.ts
|
|
424
425
|
|