@fairfox/polly 0.33.0 → 0.34.0
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.
|
@@ -1427,7 +1427,17 @@ var init_tla = __esm(() => {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
1429
|
processAssignments(assignments, state) {
|
|
1430
|
-
return assignments.filter((a) => this.shouldIncludeAssignment(a, state)).map((a) => this.mapNullAssignment(a, state));
|
|
1430
|
+
return assignments.filter((a) => this.isFieldModeled(a.field, state)).filter((a) => this.shouldIncludeAssignment(a, state)).map((a) => this.mapNullAssignment(a, state));
|
|
1431
|
+
}
|
|
1432
|
+
isFieldModeled(field, state) {
|
|
1433
|
+
const sanitized = this.sanitizeFieldName(field);
|
|
1434
|
+
const fakeConfig = {
|
|
1435
|
+
state,
|
|
1436
|
+
messages: { maxInFlight: null },
|
|
1437
|
+
onBuild: "warn",
|
|
1438
|
+
onRelease: "warn"
|
|
1439
|
+
};
|
|
1440
|
+
return this.flattenStateConfig(fakeConfig).has(sanitized);
|
|
1431
1441
|
}
|
|
1432
1442
|
shouldIncludeAssignment(assignment, state) {
|
|
1433
1443
|
if (assignment.value !== null)
|
|
@@ -5231,15 +5241,7 @@ class HandlerExtractor {
|
|
|
5231
5241
|
}
|
|
5232
5242
|
extractPropertyAssignment(prop, assignments, signalName) {
|
|
5233
5243
|
if (Node2.isPropertyAssignment(prop)) {
|
|
5234
|
-
|
|
5235
|
-
const initializer = prop.getInitializer();
|
|
5236
|
-
if (!name || !initializer)
|
|
5237
|
-
return;
|
|
5238
|
-
const value = this.extractValue(initializer);
|
|
5239
|
-
if (value === undefined)
|
|
5240
|
-
return;
|
|
5241
|
-
const field = signalName ? `${signalName}_${name}` : name;
|
|
5242
|
-
assignments.push({ field, value });
|
|
5244
|
+
this.extractRegularPropertyAssignment(prop, assignments, signalName);
|
|
5243
5245
|
return;
|
|
5244
5246
|
}
|
|
5245
5247
|
if (Node2.isShorthandPropertyAssignment(prop)) {
|
|
@@ -5252,6 +5254,37 @@ class HandlerExtractor {
|
|
|
5252
5254
|
}
|
|
5253
5255
|
}
|
|
5254
5256
|
}
|
|
5257
|
+
extractRegularPropertyAssignment(prop, assignments, signalName) {
|
|
5258
|
+
if (!Node2.isPropertyAssignment(prop))
|
|
5259
|
+
return;
|
|
5260
|
+
const name = prop.getName();
|
|
5261
|
+
const initializer = prop.getInitializer();
|
|
5262
|
+
if (!name || !initializer)
|
|
5263
|
+
return;
|
|
5264
|
+
const field = signalName ? `${signalName}_${name}` : name;
|
|
5265
|
+
const value = this.extractValue(initializer);
|
|
5266
|
+
if (value !== undefined) {
|
|
5267
|
+
assignments.push({ field, value });
|
|
5268
|
+
return;
|
|
5269
|
+
}
|
|
5270
|
+
const paramName = this.extractPayloadPropertyParam(initializer);
|
|
5271
|
+
if (paramName !== null) {
|
|
5272
|
+
assignments.push({ field, value: `param:${paramName}` });
|
|
5273
|
+
}
|
|
5274
|
+
}
|
|
5275
|
+
extractPayloadPropertyParam(initializer) {
|
|
5276
|
+
if (!Node2.isPropertyAccessExpression(initializer))
|
|
5277
|
+
return null;
|
|
5278
|
+
const parts = this.getPropertyPath(initializer).split(".");
|
|
5279
|
+
if (parts.length !== 2)
|
|
5280
|
+
return null;
|
|
5281
|
+
const [paramName, fieldName] = parts;
|
|
5282
|
+
if (paramName === undefined || fieldName === undefined)
|
|
5283
|
+
return null;
|
|
5284
|
+
if (!this.currentFunctionParams.includes(paramName))
|
|
5285
|
+
return null;
|
|
5286
|
+
return fieldName;
|
|
5287
|
+
}
|
|
5255
5288
|
extractElementAccessAssignment(left, right, assignments) {
|
|
5256
5289
|
if (!Node2.isElementAccessExpression(left))
|
|
5257
5290
|
return;
|
|
@@ -7660,4 +7693,4 @@ main().catch((error) => {
|
|
|
7660
7693
|
process.exit(1);
|
|
7661
7694
|
});
|
|
7662
7695
|
|
|
7663
|
-
//# debugId=
|
|
7696
|
+
//# debugId=BB9760A4D35CDBCE64756E2164756E21
|