@saltcorn/db-common 1.6.3-beta.1 → 1.7.0-alpha.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.
@@ -0,0 +1,530 @@
1
+ /**
2
+ * jest-compatible test helpers backed by node:test / node:assert, so test
3
+ * suites can run on node's built-in test runner without a jest dependency.
4
+ * Lives in db-common so it can be shared across packages, e.g.:
5
+ * import { describe, it, expect, beforeAll, jest } from "@saltcorn/db-common/test_expect";
6
+ * Only the surface used by the migrated test suites is implemented.
7
+ */
8
+ import assert from "node:assert";
9
+ import { inspect } from "node:util";
10
+ import { createRequire } from "node:module";
11
+ // This module is ESM, so the CommonJS `require` is not defined. jest.mock needs
12
+ // to reach into the shared CommonJS module cache to mutate cached exports;
13
+ // createRequire gives us a require bound to the same cache as the (CJS) test
14
+ // suites that call jest.mock.
15
+ const require = createRequire(import.meta.url);
16
+ import { describe as nodeDescribe, it as nodeIt, test as nodeTest, before, after, beforeEach as nodeBeforeEach, afterEach as nodeAfterEach, } from "node:test";
17
+ // node:test names the once-per-file hooks before/after; jest calls them
18
+ // beforeAll/afterAll. Wrap to drop jest's optional timeout 2nd argument.
19
+ const beforeAll = (fn) => before(fn);
20
+ const afterAll = (fn) => after(fn);
21
+ const beforeEach = (fn) => nodeBeforeEach(fn);
22
+ const afterEach = (fn) => nodeAfterEach(fn);
23
+ // ---------------------------------------------------------------------------
24
+ // .each() table tests
25
+ // ---------------------------------------------------------------------------
26
+ // jest interpolates the title with printf tokens (%s, %d, %j, ... and %# for
27
+ // the row index) or, for object rows, with $property references.
28
+ const eachTitle = (title, args, index) => {
29
+ let argIx = 0;
30
+ const withTokens = String(title).replace(/%[sdifjoOp#%]/g, (token) => {
31
+ if (token === "%%")
32
+ return "%";
33
+ if (token === "%#")
34
+ return String(index);
35
+ if (argIx >= args.length)
36
+ return token;
37
+ const arg = args[argIx++];
38
+ switch (token) {
39
+ case "%s":
40
+ return typeof arg === "string" ? arg : inspect(arg, { depth: 3 });
41
+ case "%d":
42
+ case "%f":
43
+ return String(Number(arg));
44
+ case "%i":
45
+ return String(parseInt(arg, 10));
46
+ case "%j":
47
+ return JSON.stringify(arg);
48
+ default:
49
+ return inspect(arg, { depth: 3 });
50
+ }
51
+ });
52
+ const row = args.length === 1 ? args[0] : undefined;
53
+ if (row == null || typeof row !== "object")
54
+ return withTokens;
55
+ return withTokens.replace(/\$([\w.]+)/g, (whole, path) => {
56
+ let value = row;
57
+ for (const key of path.split(".")) {
58
+ if (value == null || typeof value !== "object")
59
+ return whole;
60
+ value = value[key];
61
+ }
62
+ return typeof value === "string" ? value : inspect(value, { depth: 3 });
63
+ });
64
+ };
65
+ const eachFor = (runner) => (table) => (title, fn, ..._rest) => {
66
+ table.forEach((row, index) => {
67
+ const args = Array.isArray(row) ? row : [row];
68
+ runner(eachTitle(title, args, index), () => fn(...args));
69
+ });
70
+ };
71
+ // node:test's describe/it/test have no .each, and their exports cannot be
72
+ // mutated from here (this module is ESM), so wrap them.
73
+ const withEach = (base) => {
74
+ const wrapped = (...args) => base(...args);
75
+ for (const key of Object.getOwnPropertyNames(base)) {
76
+ if (key === "length" || key === "name" || key === "prototype")
77
+ continue;
78
+ const variant = base[key];
79
+ if (typeof variant === "function") {
80
+ const wrappedVariant = (...args) => variant(...args);
81
+ wrappedVariant.each = eachFor(variant);
82
+ wrapped[key] = wrappedVariant;
83
+ }
84
+ else
85
+ wrapped[key] = variant;
86
+ }
87
+ wrapped.each = eachFor(base);
88
+ return wrapped;
89
+ };
90
+ const describe = withEach(nodeDescribe);
91
+ const it = withEach(nodeIt);
92
+ const test = withEach(nodeTest);
93
+ export { describe, it, test, beforeAll, afterAll, beforeEach, afterEach, };
94
+ // ---------------------------------------------------------------------------
95
+ // asymmetric matchers (expect.arrayContaining / expect.objectContaining)
96
+ // ---------------------------------------------------------------------------
97
+ class ArrayContaining {
98
+ constructor(sample) {
99
+ this.sample = sample;
100
+ }
101
+ matches(actual) {
102
+ return (Array.isArray(actual) &&
103
+ this.sample.every((e) => actual.some((a) => looseEqual(a, e))));
104
+ }
105
+ }
106
+ class ObjectContaining {
107
+ constructor(sample) {
108
+ this.sample = sample;
109
+ }
110
+ matches(actual) {
111
+ if (actual == null || typeof actual !== "object")
112
+ return false;
113
+ return Object.keys(this.sample).every((k) => looseEqual(actual[k], this.sample[k]));
114
+ }
115
+ }
116
+ // expect.any(Constructor): matches any value of the given type/instance.
117
+ class Any {
118
+ constructor(sample) {
119
+ this.sample = sample;
120
+ }
121
+ matches(actual) {
122
+ switch (this.sample) {
123
+ case String:
124
+ return typeof actual === "string" || actual instanceof String;
125
+ case Number:
126
+ return typeof actual === "number" || actual instanceof Number;
127
+ case Boolean:
128
+ return typeof actual === "boolean";
129
+ case BigInt:
130
+ return typeof actual === "bigint";
131
+ case Function:
132
+ return typeof actual === "function";
133
+ case Object:
134
+ return actual !== null && typeof actual === "object";
135
+ case Array:
136
+ return Array.isArray(actual);
137
+ default:
138
+ return actual != null && actual instanceof this.sample;
139
+ }
140
+ }
141
+ }
142
+ const isAsymmetric = (x) => x instanceof ArrayContaining ||
143
+ x instanceof ObjectContaining ||
144
+ x instanceof Any;
145
+ // jest's toEqual: recursive equality that ignores prototypes and treats
146
+ // undefined-valued properties as absent.
147
+ const looseEqual = (a, b) => {
148
+ if (isAsymmetric(b))
149
+ return b.matches(a);
150
+ if (isAsymmetric(a))
151
+ return a.matches(b);
152
+ if (Object.is(a, b))
153
+ return true;
154
+ if (a == null || b == null)
155
+ return a === b;
156
+ if (typeof a !== "object" || typeof b !== "object")
157
+ return a === b;
158
+ if (a instanceof Date && b instanceof Date)
159
+ return a.getTime() === b.getTime();
160
+ if (a instanceof RegExp && b instanceof RegExp)
161
+ return a.source === b.source && a.flags === b.flags;
162
+ if (Array.isArray(a) || Array.isArray(b)) {
163
+ if (!Array.isArray(a) || !Array.isArray(b))
164
+ return false;
165
+ if (a.length !== b.length)
166
+ return false;
167
+ return a.every((v, i) => looseEqual(v, b[i]));
168
+ }
169
+ const ak = Object.keys(a).filter((k) => a[k] !== undefined);
170
+ const bk = Object.keys(b).filter((k) => b[k] !== undefined);
171
+ if (ak.length !== bk.length)
172
+ return false;
173
+ return ak.every((k) => Object.prototype.hasOwnProperty.call(b, k) && looseEqual(a[k], b[k]));
174
+ };
175
+ // jest's toMatchObject: recursive subset match (received may have extra keys).
176
+ const matchObject = (actual, expected) => {
177
+ if (isAsymmetric(expected))
178
+ return expected.matches(actual);
179
+ if (Array.isArray(expected)) {
180
+ if (!Array.isArray(actual) || actual.length !== expected.length)
181
+ return false;
182
+ return expected.every((e, i) => matchObject(actual[i], e));
183
+ }
184
+ if (expected && typeof expected === "object") {
185
+ if (actual == null || typeof actual !== "object")
186
+ return false;
187
+ return Object.keys(expected).every((k) => matchObject(actual[k], expected[k]));
188
+ }
189
+ return Object.is(actual, expected);
190
+ };
191
+ const matchError = (error, expected) => {
192
+ const message = error && error.message ? String(error.message) : String(error);
193
+ if (typeof expected === "string")
194
+ return message.includes(expected);
195
+ if (expected instanceof RegExp)
196
+ return expected.test(message);
197
+ if (typeof expected === "function")
198
+ return error instanceof expected;
199
+ return true;
200
+ };
201
+ // ---------------------------------------------------------------------------
202
+ // expect()
203
+ // ---------------------------------------------------------------------------
204
+ class Expectation {
205
+ constructor(actual, isNot = false) {
206
+ this.actual = actual;
207
+ this.isNot = isNot;
208
+ }
209
+ get not() {
210
+ return new Expectation(this.actual, !this.isNot);
211
+ }
212
+ get rejects() {
213
+ return new AsyncExpectation(this.actual, true, this.isNot);
214
+ }
215
+ get resolves() {
216
+ return new AsyncExpectation(this.actual, false, this.isNot);
217
+ }
218
+ assertPass(pass, message) {
219
+ assert.ok(this.isNot ? !pass : pass, message);
220
+ }
221
+ show(v) {
222
+ return inspect(v, { depth: 6 });
223
+ }
224
+ toBe(expected) {
225
+ if (this.isNot)
226
+ assert.notStrictEqual(this.actual, expected);
227
+ else
228
+ assert.strictEqual(this.actual, expected);
229
+ }
230
+ toEqual(expected) {
231
+ const pass = looseEqual(this.actual, expected);
232
+ this.assertPass(pass, `toEqual mismatch:\n actual: ${this.show(this.actual)}\n expected: ${this.show(expected)}`);
233
+ }
234
+ toStrictEqual(expected) {
235
+ if (isAsymmetric(expected)) {
236
+ this.assertPass(expected.matches(this.actual), `toStrictEqual mismatch: ${this.show(this.actual)}`);
237
+ return;
238
+ }
239
+ if (this.isNot)
240
+ assert.notDeepStrictEqual(this.actual, expected);
241
+ else
242
+ assert.deepStrictEqual(this.actual, expected);
243
+ }
244
+ toContain(expected) {
245
+ const pass = (typeof this.actual === "string" || Array.isArray(this.actual)) &&
246
+ this.actual.includes(expected);
247
+ this.assertPass(pass, `expected ${this.show(this.actual)} to contain ${this.show(expected)}`);
248
+ }
249
+ toContainEqual(expected) {
250
+ const pass = Array.isArray(this.actual) &&
251
+ this.actual.some((x) => looseEqual(x, expected));
252
+ this.assertPass(pass, `expected ${this.show(this.actual)} to contain equal ${this.show(expected)}`);
253
+ }
254
+ toMatchObject(expected) {
255
+ this.assertPass(matchObject(this.actual, expected), `expected ${this.show(this.actual)} to match object ${this.show(expected)}`);
256
+ }
257
+ toMatch(expected) {
258
+ const pass = typeof expected === "string"
259
+ ? String(this.actual).includes(expected)
260
+ : expected.test(this.actual);
261
+ this.assertPass(pass, `expected ${this.show(String(this.actual))} to match ${expected}`);
262
+ }
263
+ toHaveLength(length) {
264
+ this.assertPass(this.actual != null && this.actual.length === length, `expected length ${this.actual?.length} to be ${length}`);
265
+ }
266
+ toBeDefined() {
267
+ this.assertPass(this.actual !== undefined, `expected value to be defined`);
268
+ }
269
+ toBeUndefined() {
270
+ this.assertPass(this.actual === undefined, `expected ${this.show(this.actual)} to be undefined`);
271
+ }
272
+ toBeNull() {
273
+ this.assertPass(this.actual === null, `expected ${this.show(this.actual)} to be null`);
274
+ }
275
+ toBeTruthy() {
276
+ this.assertPass(!!this.actual, `expected ${this.show(this.actual)} to be truthy`);
277
+ }
278
+ toBeFalsy() {
279
+ this.assertPass(!this.actual, `expected ${this.show(this.actual)} to be falsy`);
280
+ }
281
+ toBeGreaterThan(n) {
282
+ this.assertPass(this.actual > n, `expected ${this.show(this.actual)} > ${n}`);
283
+ }
284
+ toBeLessThan(n) {
285
+ this.assertPass(this.actual < n, `expected ${this.show(this.actual)} < ${n}`);
286
+ }
287
+ toBeGreaterThanOrEqual(n) {
288
+ this.assertPass(this.actual >= n, `expected ${this.show(this.actual)} >= ${n}`);
289
+ }
290
+ toBeLessThanOrEqual(n) {
291
+ this.assertPass(this.actual <= n, `expected ${this.show(this.actual)} <= ${n}`);
292
+ }
293
+ // path is a dotted string ("a.b.0.c") or an array of keys; the expected
294
+ // value is optional - with no second argument only presence is checked.
295
+ toHaveProperty(path, ...rest) {
296
+ const keys = Array.isArray(path) ? path : String(path).split(".");
297
+ let value = this.actual;
298
+ let found = true;
299
+ for (const key of keys) {
300
+ if (value == null || !(String(key) in Object(value))) {
301
+ found = false;
302
+ break;
303
+ }
304
+ value = value[key];
305
+ }
306
+ const pass = found && (rest.length === 0 || looseEqual(value, rest[0]));
307
+ this.assertPass(pass, `expected ${this.show(this.actual)} to have property ${keys.join(".")}${rest.length ? " = " + this.show(rest[0]) : ""}`);
308
+ }
309
+ toBeInstanceOf(cls) {
310
+ this.assertPass(this.actual instanceof cls, `expected ${this.show(this.actual)} to be instance of ${cls?.name}`);
311
+ }
312
+ toThrow(expected) {
313
+ let threw = false;
314
+ let error;
315
+ try {
316
+ if (typeof this.actual === "function")
317
+ this.actual();
318
+ }
319
+ catch (e) {
320
+ threw = true;
321
+ error = e;
322
+ }
323
+ const pass = threw && (expected === undefined || matchError(error, expected));
324
+ this.assertPass(pass, `expected function to throw`);
325
+ }
326
+ toHaveBeenCalled() {
327
+ this.assertPass((this.actual?.mock?.calls?.length ?? 0) > 0, `expected mock function to have been called`);
328
+ }
329
+ // jest alias for toHaveBeenCalled
330
+ toBeCalled() {
331
+ this.toHaveBeenCalled();
332
+ }
333
+ // args may contain asymmetric matchers (expect.objectContaining etc); the
334
+ // arity must match exactly, as in jest.
335
+ toHaveBeenCalledWith(...expected) {
336
+ const calls = this.actual?.mock?.calls ?? [];
337
+ this.assertPass(calls.some((call) => looseEqual(call, expected)), `expected mock to have been called with:\n ${this.show(expected)}\nactual calls:\n ${this.show(calls)}`);
338
+ }
339
+ toHaveBeenLastCalledWith(...expected) {
340
+ const calls = this.actual?.mock?.calls ?? [];
341
+ const last = calls[calls.length - 1];
342
+ this.assertPass(calls.length > 0 && looseEqual(last, expected), `expected mock's last call to be:\n ${this.show(expected)}\nactual:\n ${this.show(last)}`);
343
+ }
344
+ toHaveBeenCalledTimes(n) {
345
+ const count = this.actual?.mock?.calls?.length ?? 0;
346
+ this.assertPass(count === n, `expected mock to have been called ${n} times, but was called ${count} times`);
347
+ }
348
+ }
349
+ // async matchers via expect(promise).rejects / .resolves
350
+ class AsyncExpectation {
351
+ constructor(actual, wantReject, isNot) {
352
+ this.actual = actual;
353
+ this.wantReject = wantReject;
354
+ this.isNot = isNot;
355
+ }
356
+ async settle() {
357
+ try {
358
+ const value = typeof this.actual === "function" ? await this.actual() : await this.actual;
359
+ return { threw: false, value };
360
+ }
361
+ catch (error) {
362
+ return { threw: true, error };
363
+ }
364
+ }
365
+ async settledExpectation() {
366
+ const { threw, value, error } = await this.settle();
367
+ if (this.wantReject) {
368
+ assert.ok(threw, `expected promise to reject, but it resolved`);
369
+ return new Expectation(error, this.isNot);
370
+ }
371
+ assert.ok(!threw, `expected promise to resolve, but it rejected: ${error}`);
372
+ return new Expectation(value, this.isNot);
373
+ }
374
+ async toThrow(expected) {
375
+ const { threw, error } = await this.settle();
376
+ if (this.wantReject) {
377
+ const pass = threw && (expected === undefined || matchError(error, expected));
378
+ assert.ok(this.isNot ? !pass : pass, `expected promise to reject${expected !== undefined ? " with " + expected : ""}`);
379
+ }
380
+ else {
381
+ assert.ok(!threw, `expected promise to resolve`);
382
+ }
383
+ }
384
+ async toBe(expected) {
385
+ (await this.settledExpectation()).toBe(expected);
386
+ }
387
+ async toEqual(expected) {
388
+ (await this.settledExpectation()).toEqual(expected);
389
+ }
390
+ async toStrictEqual(expected) {
391
+ (await this.settledExpectation()).toStrictEqual(expected);
392
+ }
393
+ }
394
+ export const expect = ((actual) => new Expectation(actual));
395
+ expect.arrayContaining = (sample) => new ArrayContaining(sample);
396
+ expect.objectContaining = (sample) => new ObjectContaining(sample);
397
+ expect.any = (sample) => new Any(sample);
398
+ // assertion-count expectation is not tracked; accepted as a no-op.
399
+ expect.assertions = (_n) => { };
400
+ // ---------------------------------------------------------------------------
401
+ // jest.fn() mock functions
402
+ // ---------------------------------------------------------------------------
403
+ export const fn = (impl) => {
404
+ const calls = [];
405
+ let implementation = impl;
406
+ let returnValue;
407
+ let hasReturnValue = false;
408
+ const mockFn = (...args) => {
409
+ calls.push(args);
410
+ if (implementation)
411
+ return implementation(...args);
412
+ if (hasReturnValue)
413
+ return returnValue;
414
+ return undefined;
415
+ };
416
+ mockFn.mock = { calls };
417
+ mockFn.mockReturnValue = (v) => {
418
+ returnValue = v;
419
+ hasReturnValue = true;
420
+ return mockFn;
421
+ };
422
+ mockFn.mockImplementation = (f) => {
423
+ implementation = f;
424
+ return mockFn;
425
+ };
426
+ mockFn.mockClear = () => {
427
+ calls.length = 0;
428
+ };
429
+ mockFn.mockReset = () => {
430
+ calls.length = 0;
431
+ implementation = undefined;
432
+ hasReturnValue = false;
433
+ returnValue = undefined;
434
+ };
435
+ return mockFn;
436
+ };
437
+ // jest.spyOn: wrap an object method with a mock that calls through to the
438
+ // original by default and can be restored. Tracked so restoreAllMocks() can
439
+ // undo every active spy.
440
+ const activeSpies = [];
441
+ const spyOn = (obj, method) => {
442
+ const original = obj[method];
443
+ const spy = fn((...args) => typeof original === "function" ? original.apply(obj, args) : undefined);
444
+ spy.mockRestore = () => {
445
+ obj[method] = original;
446
+ };
447
+ obj[method] = spy;
448
+ activeSpies.push(spy);
449
+ return spy;
450
+ };
451
+ // Mock a module. With a factory, the named exports it returns replace those
452
+ // on the (shared, require-cached) module; without one, function exports are
453
+ // auto-mocked. Mutating the cached exports means modules required afterwards
454
+ // see the mocks - so callers should require() the system-under-test after
455
+ // jest.mock (jest hoists mock calls above imports; node:test does not).
456
+ //
457
+ // require(name) must resolve from the *calling test file*, not from this
458
+ // shared shim - otherwise mocking a package only installed for the caller's
459
+ // own workspace fails here even though it resolves fine from the test file.
460
+ // captureStackTrace(target, mockFn) gets that caller's frame directly, with
461
+ // no guessing - some test setups replace global.Error with a wrapper, which
462
+ // breaks a plain new Error() here, so we go through a real native Error.
463
+ function mockFn(name, factory) {
464
+ const RealError = new Error().constructor;
465
+ const origPrepare = RealError.prepareStackTrace;
466
+ RealError.prepareStackTrace = (_, stack) => stack;
467
+ const target = {};
468
+ RealError.captureStackTrace(target, mockFn);
469
+ const stack = target.stack;
470
+ RealError.prepareStackTrace = origPrepare;
471
+ const callerFile = stack[0]?.getFileName();
472
+ const scopedRequire = callerFile ? createRequire(callerFile) : require;
473
+ const mod = scopedRequire(name);
474
+ const replacement = factory ? factory() : autoMock(mod);
475
+ let mutationFailed = false;
476
+ for (const key of Object.keys(replacement)) {
477
+ try {
478
+ mod[key] = replacement[key];
479
+ }
480
+ catch {
481
+ // non-writable export
482
+ }
483
+ if (mod[key] !== replacement[key])
484
+ mutationFailed = true;
485
+ }
486
+ // Bundled packages (esbuild/tsup output such as the `ai` package) expose
487
+ // their exports as getter-only, non-configurable properties, so the
488
+ // assignments above silently do nothing. Fall back to swapping the module's
489
+ // require-cache entry for a plain object, which every require() made after
490
+ // this call - notably the system under test - then receives. Only done when
491
+ // mutating in place actually failed, so modules that hold a reference to the
492
+ // original exports object keep seeing the mocks wherever that still works.
493
+ if (mutationFailed && mod && typeof mod === "object") {
494
+ try {
495
+ const entry = scopedRequire.cache[scopedRequire.resolve(name)];
496
+ if (entry)
497
+ entry.exports = { ...mod, ...replacement };
498
+ }
499
+ catch {
500
+ // not resolvable/cacheable (builtin, ESM); nothing more we can do
501
+ }
502
+ }
503
+ }
504
+ // jest.mock without a factory: replace every function export with a mock.
505
+ const autoMock = (mod) => {
506
+ const replacement = {};
507
+ for (const key of Object.keys(mod))
508
+ if (typeof mod[key] === "function")
509
+ replacement[key] = fn();
510
+ return replacement;
511
+ };
512
+ // ---------------------------------------------------------------------------
513
+ // jest object: setTimeout (no-op; node:test has no default timeout), fn, mock
514
+ // ---------------------------------------------------------------------------
515
+ export const jest = {
516
+ // node:test has no global default timeout, so raising it is unnecessary.
517
+ setTimeout: (_ms) => { },
518
+ fn,
519
+ spyOn,
520
+ mock: mockFn,
521
+ clearAllMocks: () => {
522
+ for (const spy of activeSpies)
523
+ spy.mockClear?.();
524
+ },
525
+ restoreAllMocks: () => {
526
+ while (activeSpies.length)
527
+ activeSpies.pop().mockRestore?.();
528
+ },
529
+ };
530
+ //# sourceMappingURL=test_expect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test_expect.js","sourceRoot":"","sources":["../test_expect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,gFAAgF;AAChF,2EAA2E;AAC3E,6EAA6E;AAC7E,8BAA8B;AAC9B,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,EAAE,IAAI,MAAM,EACZ,IAAI,IAAI,QAAQ,EAChB,MAAM,EACN,KAAK,EACL,UAAU,IAAI,cAAc,EAC5B,SAAS,IAAI,aAAa,GAC3B,MAAM,WAAW,CAAC;AAEnB,wEAAwE;AACxE,yEAAyE;AACzE,MAAM,SAAS,GAAG,CAAC,EAAO,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAC1C,MAAM,QAAQ,GAAG,CAAC,EAAO,EAAE,EAA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