fix(workflows): matchFilter strict equality + accurate comment
Concern #2: switch eq/neq to ===/!== (drop the eslint-disable); a filter {value:0} no longer matches false/''/null. Comment corrected — no implicit type normalisation; filter authors match the payload type.
This commit is contained in:
@@ -63,7 +63,7 @@ function matchFilter(filter, payload) {
|
||||
const { field, op = 'eq', value } = filter;
|
||||
const actual = payload ? payload[field] : undefined;
|
||||
// Strict equality: a filter {value: 0} must NOT match false/''/null (loose ==
|
||||
// conflated them). Numeric payloads vs string config are normalised below.
|
||||
// conflated them). Authors must therefore match the payload's actual type.
|
||||
switch (op) {
|
||||
case 'neq': return actual !== value;
|
||||
case 'truthy': return Boolean(actual);
|
||||
|
||||
Reference in New Issue
Block a user