(rules)
| 43 | } |
| 44 | |
| 45 | update(rules) { |
| 46 | if (Array.isArray(rules)) { |
| 47 | this.emit('update', { rules, ability: this }); |
| 48 | this[PRIVATE_FIELD].originalRules = Object.freeze(rules.slice(0)); |
| 49 | this[PRIVATE_FIELD].rules = this.buildIndexFor(this.rules); |
| 50 | } |
| 51 | |
| 52 | return this; |
| 53 | } |
| 54 | |
| 55 | buildIndexFor(rules) { |
| 56 | const indexedRules = {}; |
no test coverage detected