You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if the a rule's filter is an array of tag-names (ie. TagName[]), the elements are OR against each other.
eg. filter: ['b', 'strong'] is logically "element has the tag-name 'b' OR 'strong'"
But if the array contains an element of type FilterPredicate, the elements are suddenly AND against each other.
eg. filter: ['b', isStrong] is logically "element has the tag-name 'b' AND isStrong"
Also, for convenience, the rules' filters are allowed to be a single (ie. not an array)TagName or FilterPredicate type.
eg. filter: 'b' or filter: isStrong, which slightly complicates the typings and evaluation of the filters.
A better evaluation logic would be:
disallow just filter: TagName | FilterPredicate types (ie. only allow arrays)
allow nested arrays where:
the outer array is OR logically
the inner array is AND logically (ie. [A, [B, C], D] is logically "A or (B and C) or D")
The text was updated successfully, but these errors were encountered:
Currently, if the a rule's filter is an array of tag-names (ie.
TagName[]
), the elements are OR against each other.eg.
filter: ['b', 'strong']
is logically "element has the tag-name'b'
OR'strong'
"But if the array contains an element of type
FilterPredicate
, the elements are suddenly AND against each other.eg.
filter: ['b', isStrong]
is logically "element has the tag-name'b'
ANDisStrong
"Also, for convenience, the rules' filters are allowed to be a single (ie. not an array)
TagName
orFilterPredicate
type.eg.
filter: 'b'
orfilter: isStrong
, which slightly complicates the typings and evaluation of the filters.A better evaluation logic would be:
filter: TagName | FilterPredicate
types (ie. only allow arrays)(ie.
[A, [B, C], D]
is logically "A or (B and C) or D")The text was updated successfully, but these errors were encountered: