@fairfox/polly 0.18.0 → 0.19.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.
|
@@ -2212,7 +2212,9 @@ class HandlerExtractor {
|
|
|
2212
2212
|
return;
|
|
2213
2213
|
if (this.tryExtractSetConstructorPattern(fieldPath, right, assignments))
|
|
2214
2214
|
return;
|
|
2215
|
-
this.tryExtractMapConstructorPattern(fieldPath, right, assignments)
|
|
2215
|
+
if (this.tryExtractMapConstructorPattern(fieldPath, right, assignments))
|
|
2216
|
+
return;
|
|
2217
|
+
this.tryExtractSignalDirectValuePattern(fieldPath, right, assignments);
|
|
2216
2218
|
}
|
|
2217
2219
|
tryExtractStateFieldPattern(fieldPath, right, assignments) {
|
|
2218
2220
|
if (!fieldPath.startsWith("state."))
|
|
@@ -2331,6 +2333,25 @@ class HandlerExtractor {
|
|
|
2331
2333
|
}
|
|
2332
2334
|
return true;
|
|
2333
2335
|
}
|
|
2336
|
+
tryExtractSignalDirectValuePattern(fieldPath, right, assignments) {
|
|
2337
|
+
if (!fieldPath.endsWith(".value"))
|
|
2338
|
+
return false;
|
|
2339
|
+
const signalName = fieldPath.slice(0, -6);
|
|
2340
|
+
const literalValue = this.extractValue(right);
|
|
2341
|
+
if (literalValue !== undefined) {
|
|
2342
|
+
assignments.push({ field: signalName, value: literalValue });
|
|
2343
|
+
return true;
|
|
2344
|
+
}
|
|
2345
|
+
if (Node4.isPropertyAccessExpression(right)) {
|
|
2346
|
+
const rightPath = this.getPropertyPath(right);
|
|
2347
|
+
const parts = rightPath.split(".");
|
|
2348
|
+
if (parts.length === 2 && parts[0] !== undefined && parts[1] !== undefined && this.currentFunctionParams.includes(parts[0])) {
|
|
2349
|
+
assignments.push({ field: signalName, value: `param:${parts[1]}` });
|
|
2350
|
+
return true;
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
return false;
|
|
2354
|
+
}
|
|
2334
2355
|
extractSetOperation(newExpr, fieldPath, signalName) {
|
|
2335
2356
|
const args = newExpr.getArguments();
|
|
2336
2357
|
if (args.length === 0) {
|
|
@@ -2447,11 +2468,11 @@ class HandlerExtractor {
|
|
|
2447
2468
|
return null;
|
|
2448
2469
|
switch (methodName) {
|
|
2449
2470
|
case "filter":
|
|
2450
|
-
return { field: signalName, value: "
|
|
2471
|
+
return { field: signalName, value: "NDET:FILTER" };
|
|
2451
2472
|
case "map":
|
|
2452
|
-
return { field: signalName, value: "
|
|
2473
|
+
return { field: signalName, value: "NDET:MAP" };
|
|
2453
2474
|
case "slice":
|
|
2454
|
-
return { field: signalName, value: "
|
|
2475
|
+
return { field: signalName, value: "NDET:FILTER" };
|
|
2455
2476
|
case "concat":
|
|
2456
2477
|
return { field: signalName, value: "@ \\o <<payload>>" };
|
|
2457
2478
|
case "reverse":
|
|
@@ -6052,4 +6073,4 @@ main().catch((_error) => {
|
|
|
6052
6073
|
process.exit(1);
|
|
6053
6074
|
});
|
|
6054
6075
|
|
|
6055
|
-
//# debugId=
|
|
6076
|
+
//# debugId=D42055AB70D110FF64756E2164756E21
|