| author | Chloe Laisne <chloe.laisne@gmail.com> |
| Mon, 26 Sep 2016 20:17:26 +0200 | |
| changeset 297 | 50c80dda4fb8 |
| parent 254 | a7cf2887e993 |
| permissions | -rw-r--r-- |
|
217
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
1 |
import Ember from 'ember'; |
|
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
2 |
|
|
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
3 |
export function ifOr(params) { |
| 254 | 4 |
return params.find(element => Array.isArray(element) ? element.length : !!element); |
|
217
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
5 |
} |
|
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
6 |
|
|
989b9c36b849
Toolbar and Notice component styles
Chloe Laisne <chloe.laisne@gmail.com>
parents:
diff
changeset
|
7 |
export default Ember.Helper.helper(ifOr); |