@rsuci/shared-form-components 1.0.19 → 1.0.20
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roster-condition-engine.d.ts","sourceRoot":"","sources":["../../src/lib/roster-condition-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,MAAM,wBAAwB,GAChC,uBAAuB,GACvB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,cAAc,CAAC;AAEnB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAEhC;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CACtB,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,iBAAiB,EAAE,EACvC,mBAAmB,EAAE,MAAM,EAC3B,oBAAoB,EAAE,MAAM,GAC3B,+BAA+B;
|
|
1
|
+
{"version":3,"file":"roster-condition-engine.d.ts","sourceRoot":"","sources":["../../src/lib/roster-condition-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,MAAM,wBAAwB,GAChC,uBAAuB,GACvB,mBAAmB,GACnB,eAAe,GACf,gBAAgB,GAChB,cAAc,CAAC;AAEnB,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,+BAA+B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
// 1. Vérifier les références de variables
|
|
26
26
|
const refs = this.extractVariableReferences(condition);
|
|
27
|
+
// Collecter les références utilisées dans les conditions internes des jumps
|
|
28
|
+
// L'auto-référence est autorisée UNIQUEMENT dans les conditions de jump
|
|
29
|
+
const allJumps = this.extractAllJumps(condition);
|
|
30
|
+
const refsInJumpConditions = new Set();
|
|
31
|
+
for (const jump of allJumps) {
|
|
32
|
+
const jumpRefs = this.extractVariableReferences(jump.innerCondition);
|
|
33
|
+
jumpRefs.forEach(r => refsInJumpConditions.add(r));
|
|
34
|
+
}
|
|
27
35
|
for (const ref of refs) {
|
|
28
36
|
if (ref === currentVariableCode) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
// Auto-référence autorisée UNIQUEMENT dans les conditions de jump
|
|
38
|
+
if (!refsInJumpConditions.has(ref)) {
|
|
39
|
+
errors.push({
|
|
40
|
+
type: 'self_reference',
|
|
41
|
+
variableCode: ref,
|
|
42
|
+
message: 'Une variable ne peut pas se référencer elle-même (sauf dans un jump)'
|
|
43
|
+
});
|
|
44
|
+
}
|
|
34
45
|
}
|
|
35
46
|
else if (!availableCodes.has(ref)) {
|
|
36
47
|
errors.push({
|
|
@@ -41,7 +52,7 @@ export class RosterConditionEngine {
|
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
// 2. Vérifier TOUS les jumps (supporte jump() || jump() || ...)
|
|
44
|
-
|
|
55
|
+
// Note: allJumps déjà extrait plus haut
|
|
45
56
|
for (const jump of allJumps) {
|
|
46
57
|
if (!availableCodes.has(jump.target)) {
|
|
47
58
|
errors.push({
|
package/package.json
CHANGED