@routier/core 0.0.6 → 0.0.7
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/capabilities/Capability.d.ts +6 -16
- package/dist/capabilities/PerformanceCapability.d.ts +4 -6
- package/dist/capabilities/TracingCapability.d.ts +3 -6
- package/dist/capabilities/index.js +399 -343
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/types.d.ts +10 -19
- package/dist/codegen/blocks.d.ts +8 -0
- package/dist/codegen/handlers/CompareIdsHandlerBuilder.d.ts +4 -0
- package/dist/codegen/handlers/compare/CompareArrayHandler.d.ts +6 -0
- package/dist/codegen/handlers/compare/CompareDateHandler.d.ts +6 -0
- package/dist/codegen/handlers/compareIds/CompareIdsKeyHandler.d.ts +6 -0
- package/dist/codegen/handlers/index.d.ts +1 -0
- package/dist/codegen/handlers/serialize/SerializeDateHandler.d.ts +2 -1
- package/dist/codegen/handlers/serialize/SerializeFunctionHandler.d.ts +6 -0
- package/dist/codegen/index.js +39 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/collections/index.js.map +1 -1
- package/dist/expressions/index.js +108 -19
- package/dist/expressions/index.js.map +1 -1
- package/dist/index.js +1105 -496
- package/dist/index.js.map +1 -1
- package/dist/pipeline/TrampolinePipeline.d.ts +1 -0
- package/dist/pipeline/index.js +71 -47
- package/dist/pipeline/index.js.map +1 -1
- package/dist/plugins/EphemeralDataPlugin.d.ts +2 -2
- package/dist/plugins/index.js +251 -61
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/query/types.d.ts +5 -0
- package/dist/plugins/replication/OptimisticReplicationDbPlugin.d.ts +2 -1
- package/dist/plugins/replication/ReplicationDbPlugin.d.ts +2 -1
- package/dist/plugins/translators/DataTranslator.d.ts +3 -1
- package/dist/plugins/translators/JsonTranslator.d.ts +1 -0
- package/dist/plugins/translators/SqlTranslator.d.ts +1 -0
- package/dist/plugins/translators/TranslatedArrayValue.d.ts +6 -0
- package/dist/plugins/translators/TranslatedGroupValue.d.ts +6 -0
- package/dist/plugins/translators/TranslatedSingleValue.d.ts +6 -0
- package/dist/plugins/translators/index.d.ts +4 -0
- package/dist/plugins/translators/types.d.ts +10 -0
- package/dist/plugins/types.d.ts +2 -1
- package/dist/schema/PropertyInfo.d.ts +6 -1
- package/dist/schema/SchemaDefinition.d.ts +1 -1
- package/dist/schema/communication/broadcast.d.ts +3 -3
- package/dist/schema/index.js +504 -73
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/property/modifiers/SchemaTracked.d.ts +3 -1
- package/dist/schema/table/SchemaComputed.d.ts +1 -1
- package/dist/schema/testSchemas.test.d.ts +60 -36
- package/dist/schema/types.d.ts +16 -1
- package/dist/utilities/index.js +145 -2
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/strings.d.ts +34 -0
- package/dist/utilities/strings.test.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/plugins/index.js
CHANGED
|
@@ -432,8 +432,8 @@ class TrampolinePipeline {
|
|
|
432
432
|
this._hasErrored = true;
|
|
433
433
|
}
|
|
434
434
|
currentStep = null; // Stop the loop
|
|
435
|
-
//
|
|
436
|
-
|
|
435
|
+
// We don't call `done` here because an error occurred.
|
|
436
|
+
// The application should handle the uncaught exception if desired.
|
|
437
437
|
break; // Explicitly break loop on error
|
|
438
438
|
}
|
|
439
439
|
}
|
|
@@ -560,8 +560,8 @@ class AsyncPipeline {
|
|
|
560
560
|
this._hasErrored = true;
|
|
561
561
|
}
|
|
562
562
|
currentStep = null; // Stop the loop
|
|
563
|
-
//
|
|
564
|
-
|
|
563
|
+
// We don't call `done` here because an error occurred.
|
|
564
|
+
// The application should handle the uncaught exception if desired.
|
|
565
565
|
break; // Explicitly break loop on error
|
|
566
566
|
}
|
|
567
567
|
}
|
|
@@ -595,88 +595,112 @@ class AsyncPipeline {
|
|
|
595
595
|
*/
|
|
596
596
|
class WorkPipeline {
|
|
597
597
|
unitsOfWork = [];
|
|
598
|
+
_hasErrored = false; // Flag to prevent calling done on error
|
|
598
599
|
filter(done) {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
// Fast path for empty pipeline
|
|
602
|
-
if (unitsLength === 0) {
|
|
600
|
+
this._hasErrored = false; // Reset error flag on new execution
|
|
601
|
+
if (this.unitsOfWork.length === 0) {
|
|
603
602
|
queueMicrotask(() => done(_results__WEBPACK_IMPORTED_MODULE_0__.Result.success()));
|
|
604
603
|
return;
|
|
605
604
|
}
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
try {
|
|
609
|
-
units[0]((result) => {
|
|
610
|
-
queueMicrotask(() => done(result));
|
|
611
|
-
});
|
|
612
|
-
}
|
|
613
|
-
catch (error) {
|
|
614
|
-
done(_results__WEBPACK_IMPORTED_MODULE_0__.Result.error(error));
|
|
615
|
-
}
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
let isRunning = false;
|
|
619
|
-
let hasErrored = false;
|
|
605
|
+
let index = 0;
|
|
606
|
+
let isRunning = false; // Guard against overlapping trampoline calls
|
|
620
607
|
try {
|
|
621
|
-
|
|
608
|
+
// --- Revised Completion Logic --- (Moved up for clarity)
|
|
609
|
+
const finalStepSentinel = () => {
|
|
610
|
+
// Only call done if no error has occurred
|
|
611
|
+
if (!this._hasErrored) {
|
|
612
|
+
queueMicrotask(() => done(_results__WEBPACK_IMPORTED_MODULE_0__.Result.success()));
|
|
613
|
+
}
|
|
614
|
+
return null; // Stop the trampoline
|
|
615
|
+
};
|
|
616
|
+
const createStepRevised = (idx) => {
|
|
622
617
|
return () => {
|
|
623
|
-
if (
|
|
624
|
-
return null;
|
|
625
|
-
if (idx >=
|
|
626
|
-
|
|
627
|
-
queueMicrotask(() => done(_results__WEBPACK_IMPORTED_MODULE_0__.Result.success()));
|
|
628
|
-
}
|
|
629
|
-
return null;
|
|
618
|
+
if (this._hasErrored)
|
|
619
|
+
return null; // Stop if an error occurred elsewhere
|
|
620
|
+
if (idx >= this.unitsOfWork.length) {
|
|
621
|
+
return finalStepSentinel(); // Execute the dedicated final step
|
|
630
622
|
}
|
|
631
|
-
const processor =
|
|
632
|
-
|
|
623
|
+
const processor = this.unitsOfWork[idx];
|
|
624
|
+
// Initialize syncCallbackResult to null to satisfy StepResult type
|
|
625
|
+
let syncCallbackResult = null;
|
|
633
626
|
let calledSync = false;
|
|
634
627
|
try {
|
|
635
628
|
processor((result) => {
|
|
629
|
+
// --- Error Handling ---
|
|
636
630
|
if (result.ok === _results__WEBPACK_IMPORTED_MODULE_0__.Result.ERROR) {
|
|
637
|
-
|
|
631
|
+
console.error(`Error reported by AsyncPipeline at index ${idx}:`, result.error);
|
|
632
|
+
this._hasErrored = true; // Set flag
|
|
633
|
+
// Throw the error to be caught by outer try...catch blocks
|
|
638
634
|
throw result.error;
|
|
639
635
|
}
|
|
640
|
-
|
|
636
|
+
// --- /Error Handling ---
|
|
637
|
+
// If no error, proceed as before
|
|
638
|
+
index = idx + 1; // Update index for the next step
|
|
639
|
+
const nextStep = createStepRevised(index); // Use updated index
|
|
641
640
|
if (isRunning) {
|
|
642
|
-
|
|
641
|
+
// Callback was synchronous
|
|
642
|
+
syncCallbackResult = nextStep; // Store next step function
|
|
643
643
|
calledSync = true;
|
|
644
644
|
}
|
|
645
645
|
else {
|
|
646
|
+
// Callback was asynchronous, restart trampoline
|
|
646
647
|
trampoline(nextStep);
|
|
647
648
|
}
|
|
648
649
|
});
|
|
649
650
|
}
|
|
650
651
|
catch (error) {
|
|
651
|
-
|
|
652
|
+
if (!this._hasErrored) { // Check flag to avoid double logging if error was from callback
|
|
653
|
+
console.error(`Error thrown by processor at index ${idx} or its callback:`, error);
|
|
654
|
+
this._hasErrored = true;
|
|
655
|
+
}
|
|
656
|
+
// Rethrow to be caught by the trampoline's catch block
|
|
652
657
|
throw error;
|
|
653
658
|
}
|
|
654
|
-
|
|
659
|
+
if (calledSync) {
|
|
660
|
+
// Return the next step function for the sync loop
|
|
661
|
+
return syncCallbackResult;
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
// Pause trampoline for async, loop will stop as step returns null
|
|
665
|
+
return null;
|
|
666
|
+
}
|
|
655
667
|
};
|
|
656
668
|
};
|
|
669
|
+
// The trampoline loop
|
|
657
670
|
const trampoline = (step) => {
|
|
658
|
-
if (isRunning)
|
|
671
|
+
if (isRunning) {
|
|
659
672
|
return;
|
|
673
|
+
}
|
|
660
674
|
isRunning = true;
|
|
661
675
|
let currentStep = step;
|
|
662
|
-
while (currentStep) {
|
|
676
|
+
while (typeof currentStep === 'function') {
|
|
663
677
|
try {
|
|
664
|
-
if
|
|
678
|
+
// Stop immediately if an error was flagged elsewhere
|
|
679
|
+
if (this._hasErrored) {
|
|
665
680
|
currentStep = null;
|
|
666
681
|
break;
|
|
667
682
|
}
|
|
668
|
-
currentStep = currentStep();
|
|
683
|
+
currentStep = currentStep(); // Execute step, get next step or null
|
|
669
684
|
}
|
|
670
|
-
catch (
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
685
|
+
catch (trampolineError) {
|
|
686
|
+
// Catch errors propagated from step execution (processor or callback errors)
|
|
687
|
+
if (!this._hasErrored) { // Avoid double logging
|
|
688
|
+
console.error("Error during trampoline step execution:", trampolineError);
|
|
689
|
+
this._hasErrored = true;
|
|
690
|
+
}
|
|
691
|
+
currentStep = null; // Stop the loop
|
|
692
|
+
// We don't call `done` here because an error occurred.
|
|
693
|
+
// The application should handle the uncaught exception if desired.
|
|
694
|
+
break; // Explicitly break loop on error
|
|
675
695
|
}
|
|
676
696
|
}
|
|
697
|
+
// Loop ends when currentStep is null or loop is broken by error
|
|
677
698
|
isRunning = false;
|
|
699
|
+
// Completion check is now handled by finalStepSentinel ensuring `done` isn't called on error.
|
|
678
700
|
};
|
|
679
|
-
|
|
701
|
+
// --- Start the process ---
|
|
702
|
+
index = 0; // Reset index
|
|
703
|
+
trampoline(createStepRevised(0)); // Start with the revised step creator
|
|
680
704
|
}
|
|
681
705
|
catch (error) {
|
|
682
706
|
done(_results__WEBPACK_IMPORTED_MODULE_0__.Result.error(error));
|
|
@@ -768,6 +792,7 @@ class EphemeralDataPlugin {
|
|
|
768
792
|
}
|
|
769
793
|
});
|
|
770
794
|
}
|
|
795
|
+
// If there is no work, just return the result
|
|
771
796
|
if (!hasWork) {
|
|
772
797
|
done(_results__WEBPACK_IMPORTED_MODULE_2__.PluginEventResult.success(event.id, bulkPersistResult));
|
|
773
798
|
return;
|
|
@@ -1065,9 +1090,6 @@ const getMemoryPluginCollectionSize = (plugin, schema) => {
|
|
|
1065
1090
|
}
|
|
1066
1091
|
throw new Error("Cannot get size of collection for MemoryPlugin, not an instance of MemoryPlugin");
|
|
1067
1092
|
};
|
|
1068
|
-
const HYDRATION_STATUS_PENDING = "hydration-pending";
|
|
1069
|
-
const HYDRATION_STATUS_ERROR = "hydration-error";
|
|
1070
|
-
const HYDRATION_STATUS_SUCCESS = "hydration-success";
|
|
1071
1093
|
let hydrationStatus = "hydration-not-started";
|
|
1072
1094
|
class OptimisticReplicationDbPlugin {
|
|
1073
1095
|
plugins;
|
|
@@ -1387,6 +1409,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1387
1409
|
__webpack_require__.d(__webpack_exports__, {
|
|
1388
1410
|
DataTranslator: () => (DataTranslator)
|
|
1389
1411
|
});
|
|
1412
|
+
/* ESM import */var _TranslatedArrayValue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TranslatedArrayValue */ "./src/plugins/translators/TranslatedArrayValue.ts");
|
|
1413
|
+
/* ESM import */var _TranslatedGroupValue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TranslatedGroupValue */ "./src/plugins/translators/TranslatedGroupValue.ts");
|
|
1414
|
+
/* ESM import */var _TranslatedSingleValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TranslatedSingleValue */ "./src/plugins/translators/TranslatedSingleValue.ts");
|
|
1415
|
+
|
|
1416
|
+
|
|
1417
|
+
|
|
1390
1418
|
class DataTranslator {
|
|
1391
1419
|
query;
|
|
1392
1420
|
functionMap = {
|
|
@@ -1399,7 +1427,8 @@ class DataTranslator {
|
|
|
1399
1427
|
skip: (data, option) => this.skip(data, option),
|
|
1400
1428
|
sort: (data, option) => this.sort(data, option),
|
|
1401
1429
|
sum: (data, option) => this.sum(data, option),
|
|
1402
|
-
take: (data, option) => this.take(data, option)
|
|
1430
|
+
take: (data, option) => this.take(data, option),
|
|
1431
|
+
group: (data, option) => this.group(data, option)
|
|
1403
1432
|
};
|
|
1404
1433
|
constructor(query) {
|
|
1405
1434
|
this.query = query;
|
|
@@ -1408,7 +1437,13 @@ class DataTranslator {
|
|
|
1408
1437
|
this.query.options.forEach(item => {
|
|
1409
1438
|
data = this.functionMap[item.name](data, item);
|
|
1410
1439
|
});
|
|
1411
|
-
|
|
1440
|
+
if (Array.isArray(data)) {
|
|
1441
|
+
return new _TranslatedArrayValue__WEBPACK_IMPORTED_MODULE_0__.TranslatedArrayValue(data);
|
|
1442
|
+
}
|
|
1443
|
+
if (this.query.options.has("group")) {
|
|
1444
|
+
return new _TranslatedGroupValue__WEBPACK_IMPORTED_MODULE_1__.TranslatedGroupValue(data);
|
|
1445
|
+
}
|
|
1446
|
+
return new _TranslatedSingleValue__WEBPACK_IMPORTED_MODULE_2__.TranslatedSingleValue(data);
|
|
1412
1447
|
}
|
|
1413
1448
|
}
|
|
1414
1449
|
|
|
@@ -1447,24 +1482,54 @@ class JsonTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTr
|
|
|
1447
1482
|
if (Array.isArray(data) == false) {
|
|
1448
1483
|
throw new Error("Can only map an array of data");
|
|
1449
1484
|
}
|
|
1450
|
-
const response =
|
|
1451
|
-
// We want deserialization to flow through mappings
|
|
1452
|
-
// TODO: Speed this up!
|
|
1453
|
-
// Generate a function on the fly?
|
|
1485
|
+
const response = new Array(data.length);
|
|
1454
1486
|
for (let i = 0, length = data.length; i < length; i++) {
|
|
1455
1487
|
for (let j = 0, l = option.value.fields.length; j < l; j++) {
|
|
1456
1488
|
const field = option.value.fields[j];
|
|
1457
1489
|
if (field.property != null) {
|
|
1458
1490
|
const value = field.property.getValue(data[i]);
|
|
1459
1491
|
if (value != null) {
|
|
1460
|
-
|
|
1492
|
+
// Some types do not support deserialization (Array, Function, Computed, etc), just directly set the incoming value
|
|
1493
|
+
const resolvedValue = field.property.supportsDeserialization ? field.property.deserialize(value) : value;
|
|
1494
|
+
field.property.setValue(data[i], resolvedValue);
|
|
1461
1495
|
}
|
|
1462
1496
|
}
|
|
1463
1497
|
}
|
|
1464
|
-
response
|
|
1498
|
+
response[i] = option.value.selector(data[i]);
|
|
1465
1499
|
}
|
|
1466
1500
|
return response;
|
|
1467
1501
|
}
|
|
1502
|
+
group(data, option) {
|
|
1503
|
+
if (Array.isArray(data) == false) {
|
|
1504
|
+
throw new Error("Can only group an array of data");
|
|
1505
|
+
}
|
|
1506
|
+
const group = {};
|
|
1507
|
+
for (let i = 0, length = data.length; i < length; i++) {
|
|
1508
|
+
const keyValue = option.value.selector(data[i]);
|
|
1509
|
+
if (!group[keyValue]) {
|
|
1510
|
+
group[keyValue] = [];
|
|
1511
|
+
}
|
|
1512
|
+
const item = {};
|
|
1513
|
+
for (let j = 0, l = option.value.fields.length; j < l; j++) {
|
|
1514
|
+
const field = option.value.fields[j];
|
|
1515
|
+
if (field.property != null) {
|
|
1516
|
+
const value = field.property.getValue(data[i]);
|
|
1517
|
+
if (value != null) {
|
|
1518
|
+
// Some types do not support deserialization (Array, Function, Computed, etc), just directly set the incoming value
|
|
1519
|
+
const resolvedValue = field.property.supportsDeserialization ? field.property.deserialize(value) : value;
|
|
1520
|
+
field.property.setValue(item, resolvedValue);
|
|
1521
|
+
continue;
|
|
1522
|
+
}
|
|
1523
|
+
// The property exists, lets set it to the value (null/undefined)
|
|
1524
|
+
if (Object.hasOwn(data[i], field.destinationName)) {
|
|
1525
|
+
field.property.setValue(item, value);
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
group[keyValue].push(item);
|
|
1530
|
+
}
|
|
1531
|
+
return group;
|
|
1532
|
+
}
|
|
1468
1533
|
count(data, _) {
|
|
1469
1534
|
if (Array.isArray(data)) {
|
|
1470
1535
|
return data.length;
|
|
@@ -1625,6 +1690,30 @@ class SqlTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTra
|
|
|
1625
1690
|
sort(data, _) {
|
|
1626
1691
|
return data;
|
|
1627
1692
|
}
|
|
1693
|
+
group(data, option) {
|
|
1694
|
+
if (Array.isArray(data) == false) {
|
|
1695
|
+
throw new Error("Can only group an array of data");
|
|
1696
|
+
}
|
|
1697
|
+
const group = {};
|
|
1698
|
+
for (let i = 0, length = data.length; i < length; i++) {
|
|
1699
|
+
const keyValue = option.value.selector(data[i]);
|
|
1700
|
+
if (!group[keyValue]) {
|
|
1701
|
+
group[keyValue] = [];
|
|
1702
|
+
}
|
|
1703
|
+
const item = {};
|
|
1704
|
+
for (let j = 0, l = option.value.fields.length; j < l; j++) {
|
|
1705
|
+
const field = option.value.fields[j];
|
|
1706
|
+
if (field.property != null) {
|
|
1707
|
+
const value = field.property.getValue(data[i]);
|
|
1708
|
+
if (value != null) {
|
|
1709
|
+
field.property.setValue(item, field.property.deserialize(value));
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
group[keyValue].push(item);
|
|
1714
|
+
}
|
|
1715
|
+
return group;
|
|
1716
|
+
}
|
|
1628
1717
|
map(data, option) {
|
|
1629
1718
|
if (Array.isArray(data) == false) {
|
|
1630
1719
|
throw new Error("Can only map an array of data");
|
|
@@ -1652,6 +1741,91 @@ class SqlTranslator extends _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTra
|
|
|
1652
1741
|
}
|
|
1653
1742
|
|
|
1654
1743
|
|
|
1744
|
+
}),
|
|
1745
|
+
"./src/plugins/translators/TranslatedArrayValue.ts":
|
|
1746
|
+
/*!*********************************************************!*\
|
|
1747
|
+
!*** ./src/plugins/translators/TranslatedArrayValue.ts ***!
|
|
1748
|
+
\*********************************************************/
|
|
1749
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1750
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1751
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1752
|
+
TranslatedArrayValue: () => (TranslatedArrayValue)
|
|
1753
|
+
});
|
|
1754
|
+
class TranslatedArrayValue {
|
|
1755
|
+
value;
|
|
1756
|
+
constructor(value) {
|
|
1757
|
+
this.value = value;
|
|
1758
|
+
}
|
|
1759
|
+
forEach(callback) {
|
|
1760
|
+
const data = this.value;
|
|
1761
|
+
for (let i = 0, length = data.length; i < length; i++) {
|
|
1762
|
+
const result = callback(data[i]);
|
|
1763
|
+
if (result) {
|
|
1764
|
+
// reassign if the callback returns a result
|
|
1765
|
+
data[i] = result;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
|
|
1772
|
+
}),
|
|
1773
|
+
"./src/plugins/translators/TranslatedGroupValue.ts":
|
|
1774
|
+
/*!*********************************************************!*\
|
|
1775
|
+
!*** ./src/plugins/translators/TranslatedGroupValue.ts ***!
|
|
1776
|
+
\*********************************************************/
|
|
1777
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1778
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1779
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1780
|
+
TranslatedGroupValue: () => (TranslatedGroupValue)
|
|
1781
|
+
});
|
|
1782
|
+
class TranslatedGroupValue {
|
|
1783
|
+
value;
|
|
1784
|
+
constructor(value) {
|
|
1785
|
+
this.value = value;
|
|
1786
|
+
}
|
|
1787
|
+
forEach(callback) {
|
|
1788
|
+
const group = this.value;
|
|
1789
|
+
const keys = Object.keys(group);
|
|
1790
|
+
for (let i = 0, length = keys.length; i < length; i++) {
|
|
1791
|
+
const key = keys[i];
|
|
1792
|
+
const data = group[key];
|
|
1793
|
+
for (let j = 0, len = data.length; j < len; j++) {
|
|
1794
|
+
const result = callback(data[j]);
|
|
1795
|
+
if (result) {
|
|
1796
|
+
// reassign if the callback returns a result
|
|
1797
|
+
data[j] = result;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
}),
|
|
1806
|
+
"./src/plugins/translators/TranslatedSingleValue.ts":
|
|
1807
|
+
/*!**********************************************************!*\
|
|
1808
|
+
!*** ./src/plugins/translators/TranslatedSingleValue.ts ***!
|
|
1809
|
+
\**********************************************************/
|
|
1810
|
+
(function (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
1811
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1812
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1813
|
+
TranslatedSingleValue: () => (TranslatedSingleValue)
|
|
1814
|
+
});
|
|
1815
|
+
class TranslatedSingleValue {
|
|
1816
|
+
value;
|
|
1817
|
+
constructor(value) {
|
|
1818
|
+
this.value = value;
|
|
1819
|
+
}
|
|
1820
|
+
forEach(callback) {
|
|
1821
|
+
const result = callback(this.value);
|
|
1822
|
+
if (result) {
|
|
1823
|
+
this.value = result;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
|
|
1655
1829
|
}),
|
|
1656
1830
|
"./src/plugins/translators/index.ts":
|
|
1657
1831
|
/*!******************************************!*\
|
|
@@ -1662,11 +1836,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1662
1836
|
__webpack_require__.d(__webpack_exports__, {
|
|
1663
1837
|
DataTranslator: () => (/* reexport safe */ _DataTranslator__WEBPACK_IMPORTED_MODULE_0__.DataTranslator),
|
|
1664
1838
|
JsonTranslator: () => (/* reexport safe */ _JsonTranslator__WEBPACK_IMPORTED_MODULE_1__.JsonTranslator),
|
|
1665
|
-
SqlTranslator: () => (/* reexport safe */ _SqlTranslator__WEBPACK_IMPORTED_MODULE_2__.SqlTranslator)
|
|
1839
|
+
SqlTranslator: () => (/* reexport safe */ _SqlTranslator__WEBPACK_IMPORTED_MODULE_2__.SqlTranslator),
|
|
1840
|
+
TranslatedArrayValue: () => (/* reexport safe */ _TranslatedArrayValue__WEBPACK_IMPORTED_MODULE_3__.TranslatedArrayValue),
|
|
1841
|
+
TranslatedGroupValue: () => (/* reexport safe */ _TranslatedGroupValue__WEBPACK_IMPORTED_MODULE_4__.TranslatedGroupValue),
|
|
1842
|
+
TranslatedSingleValue: () => (/* reexport safe */ _TranslatedSingleValue__WEBPACK_IMPORTED_MODULE_5__.TranslatedSingleValue)
|
|
1666
1843
|
});
|
|
1667
1844
|
/* ESM import */var _DataTranslator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DataTranslator */ "./src/plugins/translators/DataTranslator.ts");
|
|
1668
1845
|
/* ESM import */var _JsonTranslator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./JsonTranslator */ "./src/plugins/translators/JsonTranslator.ts");
|
|
1669
1846
|
/* ESM import */var _SqlTranslator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SqlTranslator */ "./src/plugins/translators/SqlTranslator.ts");
|
|
1847
|
+
/* ESM import */var _TranslatedArrayValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TranslatedArrayValue */ "./src/plugins/translators/TranslatedArrayValue.ts");
|
|
1848
|
+
/* ESM import */var _TranslatedGroupValue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TranslatedGroupValue */ "./src/plugins/translators/TranslatedGroupValue.ts");
|
|
1849
|
+
/* ESM import */var _TranslatedSingleValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TranslatedSingleValue */ "./src/plugins/translators/TranslatedSingleValue.ts");
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
|
|
1670
1854
|
|
|
1671
1855
|
|
|
1672
1856
|
|
|
@@ -1940,7 +2124,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
1940
2124
|
QueryOptionsCollection: () => (/* reexport safe */ _query__WEBPACK_IMPORTED_MODULE_2__.QueryOptionsCollection),
|
|
1941
2125
|
QueryOrdering: () => (/* reexport safe */ _query__WEBPACK_IMPORTED_MODULE_2__.QueryOrdering),
|
|
1942
2126
|
ReplicationDbPlugin: () => (/* reexport safe */ _replication__WEBPACK_IMPORTED_MODULE_1__.ReplicationDbPlugin),
|
|
1943
|
-
SqlTranslator: () => (/* reexport safe */ _translators__WEBPACK_IMPORTED_MODULE_0__.SqlTranslator)
|
|
2127
|
+
SqlTranslator: () => (/* reexport safe */ _translators__WEBPACK_IMPORTED_MODULE_0__.SqlTranslator),
|
|
2128
|
+
TranslatedArrayValue: () => (/* reexport safe */ _translators__WEBPACK_IMPORTED_MODULE_0__.TranslatedArrayValue),
|
|
2129
|
+
TranslatedGroupValue: () => (/* reexport safe */ _translators__WEBPACK_IMPORTED_MODULE_0__.TranslatedGroupValue),
|
|
2130
|
+
TranslatedSingleValue: () => (/* reexport safe */ _translators__WEBPACK_IMPORTED_MODULE_0__.TranslatedSingleValue)
|
|
1944
2131
|
});
|
|
1945
2132
|
/* ESM import */var _translators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translators */ "./src/plugins/translators/index.ts");
|
|
1946
2133
|
/* ESM import */var _replication__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./replication */ "./src/plugins/replication/index.ts");
|
|
@@ -1963,6 +2150,9 @@ var __webpack_exports__QueryOptionsCollection = __webpack_exports__.QueryOptions
|
|
|
1963
2150
|
var __webpack_exports__QueryOrdering = __webpack_exports__.QueryOrdering;
|
|
1964
2151
|
var __webpack_exports__ReplicationDbPlugin = __webpack_exports__.ReplicationDbPlugin;
|
|
1965
2152
|
var __webpack_exports__SqlTranslator = __webpack_exports__.SqlTranslator;
|
|
1966
|
-
|
|
2153
|
+
var __webpack_exports__TranslatedArrayValue = __webpack_exports__.TranslatedArrayValue;
|
|
2154
|
+
var __webpack_exports__TranslatedGroupValue = __webpack_exports__.TranslatedGroupValue;
|
|
2155
|
+
var __webpack_exports__TranslatedSingleValue = __webpack_exports__.TranslatedSingleValue;
|
|
2156
|
+
export { __webpack_exports__DataTranslator as DataTranslator, __webpack_exports__EphemeralDataPlugin as EphemeralDataPlugin, __webpack_exports__JsonTranslator as JsonTranslator, __webpack_exports__OptimisticReplicationDbPlugin as OptimisticReplicationDbPlugin, __webpack_exports__Query as Query, __webpack_exports__QueryOptionsCollection as QueryOptionsCollection, __webpack_exports__QueryOrdering as QueryOrdering, __webpack_exports__ReplicationDbPlugin as ReplicationDbPlugin, __webpack_exports__SqlTranslator as SqlTranslator, __webpack_exports__TranslatedArrayValue as TranslatedArrayValue, __webpack_exports__TranslatedGroupValue as TranslatedGroupValue, __webpack_exports__TranslatedSingleValue as TranslatedSingleValue };
|
|
1967
2157
|
|
|
1968
2158
|
//# sourceMappingURL=index.js.map
|