Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProcessingChaining next function #15

Open
smart--petea opened this issue Sep 4, 2014 · 1 comment
Open

ProcessingChaining next function #15

smart--petea opened this issue Sep 4, 2014 · 1 comment

Comments

@smart--petea
Copy link
Contributor

The expression

(chain[idx].names && chain[idx].names.indexOf(handler.name) != -1) || !chain[idx].names

is equivalent to

 !chain[idx].names ||  ~chain[idx].names.indexOf(handler.name)
@smart--petea
Copy link
Contributor Author

if user will add to processingChaing a proc like

{
  fn: function(){},
  name: [],
}

with name=[] then the expression

!chain[idx].names ||  ~chain[idx].names.indexOf(handler.name)

will be false. If to judge that name=[] should match the case of general use then the expression from above must be true. Maybe to check that name are empty array. We obtain

!chain[idx].names || !chain[idx].names.length ||  ~chain[idx].names.indexOf(handler.name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants