Showing
1 changed file
with
19 additions
and
0 deletions
public/js/common/helpers/isEqualOr.js
0 → 100644
1 | +module.exports = function() { | ||
2 | + let args = Array.prototype.slice.call(arguments); | ||
3 | + let v1 = args[0]; | ||
4 | + let opt = args[args.length - 1]; | ||
5 | + let isTrue = false; | ||
6 | + | ||
7 | + for (let i = 1; i < args.length - 1; i++) { | ||
8 | + if (v1 === args[i]) { | ||
9 | + isTrue = true; | ||
10 | + break; | ||
11 | + } | ||
12 | + } | ||
13 | + | ||
14 | + if (isTrue) { | ||
15 | + return opt.fn(this); // eslint-disable-line | ||
16 | + } else { | ||
17 | + return opt.inverse(this); // eslint-disable-line | ||
18 | + } | ||
19 | +}; |
-
Please register or login to post a comment